TypeScript typings for Content API for Shopping v2.1
Manage your product listings and accounts for Google Shopping
For detailed description please check documentation.
Installing
Install typings for Content API for Shopping:
npm install @types/gapi.client.content-v2.1 --save-dev
Usage
You need to initialize Google API client in your code:
gapi.load('client', () => {
});
Then load api client wrapper:
gapi.client.load('https://shoppingcontent.googleapis.com/$discovery/rest?version=v2.1', () => {
});
gapi.client.load('content', 'v2.1', () => {
});
Don't forget to authenticate your client before sending any request to resources:
var client_id = '',
scope = [
'https://www.googleapis.com/auth/content',
],
immediate = true;
gapi.auth.authorize(
{ client_id: client_id, scope: scope, immediate: immediate },
authResult => {
if (authResult && !authResult.error) {
} else {
}
});
After that you can use Content API for Shopping resources:
await gapi.client.content.accounts.authinfo({ });
await gapi.client.content.accounts.claimwebsite({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.custombatch({ });
await gapi.client.content.accounts.delete({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.get({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.insert({ merchantId: "merchantId", });
await gapi.client.content.accounts.link({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.list({ merchantId: "merchantId", });
await gapi.client.content.accounts.listlinks({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.requestphoneverification({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.update({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.updatelabels({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounts.verifyphonenumber({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accountstatuses.custombatch({ });
await gapi.client.content.accountstatuses.get({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accountstatuses.list({ merchantId: "merchantId", });
await gapi.client.content.accounttax.custombatch({ });
await gapi.client.content.accounttax.get({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.accounttax.list({ merchantId: "merchantId", });
await gapi.client.content.accounttax.update({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.buyongoogleprograms.activate({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.buyongoogleprograms.get({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.buyongoogleprograms.onboard({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.buyongoogleprograms.patch({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.buyongoogleprograms.pause({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.buyongoogleprograms.requestreview({ merchantId: "merchantId", regionCode: "regionCode", });
await gapi.client.content.collections.create({ merchantId: "merchantId", });
await gapi.client.content.collections.delete({ collectionId: "collectionId", merchantId: "merchantId", });
await gapi.client.content.collections.get({ collectionId: "collectionId", merchantId: "merchantId", });
await gapi.client.content.collections.list({ merchantId: "merchantId", });
await gapi.client.content.collectionstatuses.get({ collectionId: "collectionId", merchantId: "merchantId", });
await gapi.client.content.collectionstatuses.list({ merchantId: "merchantId", });
await gapi.client.content.conversionsources.create({ merchantId: "merchantId", });
await gapi.client.content.conversionsources.delete({ conversionSourceId: "conversionSourceId", merchantId: "merchantId", });
await gapi.client.content.conversionsources.get({ conversionSourceId: "conversionSourceId", merchantId: "merchantId", });
await gapi.client.content.conversionsources.list({ merchantId: "merchantId", });
await gapi.client.content.conversionsources.patch({ conversionSourceId: "conversionSourceId", merchantId: "merchantId", });
await gapi.client.content.conversionsources.undelete({ conversionSourceId: "conversionSourceId", merchantId: "merchantId", });
await gapi.client.content.csses.get({ cssDomainId: "cssDomainId", cssGroupId: "cssGroupId", });
await gapi.client.content.csses.list({ cssGroupId: "cssGroupId", });
await gapi.client.content.csses.updatelabels({ cssDomainId: "cssDomainId", cssGroupId: "cssGroupId", });
await gapi.client.content.datafeeds.custombatch({ });
await gapi.client.content.datafeeds.delete({ datafeedId: "datafeedId", merchantId: "merchantId", });
await gapi.client.content.datafeeds.fetchnow({ datafeedId: "datafeedId", merchantId: "merchantId", });
await gapi.client.content.datafeeds.get({ datafeedId: "datafeedId", merchantId: "merchantId", });
await gapi.client.content.datafeeds.insert({ merchantId: "merchantId", });
await gapi.client.content.datafeeds.list({ merchantId: "merchantId", });
await gapi.client.content.datafeeds.update({ datafeedId: "datafeedId", merchantId: "merchantId", });
await gapi.client.content.datafeedstatuses.custombatch({ });
await gapi.client.content.datafeedstatuses.get({ datafeedId: "datafeedId", merchantId: "merchantId", });
await gapi.client.content.datafeedstatuses.list({ merchantId: "merchantId", });
await gapi.client.content.freelistingsprogram.get({ merchantId: "merchantId", });
await gapi.client.content.freelistingsprogram.requestreview({ merchantId: "merchantId", });
await gapi.client.content.liasettings.custombatch({ });
await gapi.client.content.liasettings.get({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.liasettings.getaccessiblegmbaccounts({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.liasettings.list({ merchantId: "merchantId", });
await gapi.client.content.liasettings.listposdataproviders({ });
await gapi.client.content.liasettings.requestgmbaccess({ accountId: "accountId", gmbEmail: "gmbEmail", merchantId: "merchantId", });
await gapi.client.content.liasettings.requestinventoryverification({ accountId: "accountId", country: "country", merchantId: "merchantId", });
await gapi.client.content.liasettings.setinventoryverificationcontact({ accountId: "accountId", contactEmail: "contactEmail", contactName: "contactName", country: "country", language: "language", merchantId: "merchantId", });
await gapi.client.content.liasettings.setomnichannelexperience({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.liasettings.setposdataprovider({ accountId: "accountId", country: "country", merchantId: "merchantId", });
await gapi.client.content.liasettings.update({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.localinventory.custombatch({ });
await gapi.client.content.localinventory.insert({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.merchantsupport.renderaccountissues({ merchantId: "merchantId", });
await gapi.client.content.merchantsupport.renderproductissues({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.orderinvoices.createchargeinvoice({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orderinvoices.createrefundinvoice({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orderreports.listdisbursements({ merchantId: "merchantId", });
await gapi.client.content.orderreports.listtransactions({ disbursementId: "disbursementId", merchantId: "merchantId", });
await gapi.client.content.orderreturns.acknowledge({ merchantId: "merchantId", returnId: "returnId", });
await gapi.client.content.orderreturns.createorderreturn({ merchantId: "merchantId", });
await gapi.client.content.orderreturns.get({ merchantId: "merchantId", returnId: "returnId", });
await gapi.client.content.orderreturns.list({ merchantId: "merchantId", });
await gapi.client.content.orderreturns.process({ merchantId: "merchantId", returnId: "returnId", });
await gapi.client.content.orders.acknowledge({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.advancetestorder({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.cancel({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.cancellineitem({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.canceltestorderbycustomer({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.captureOrder({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.createtestorder({ merchantId: "merchantId", });
await gapi.client.content.orders.createtestreturn({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.get({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.getbymerchantorderid({ merchantId: "merchantId", merchantOrderId: "merchantOrderId", });
await gapi.client.content.orders.gettestordertemplate({ merchantId: "merchantId", templateName: "templateName", });
await gapi.client.content.orders.instorerefundlineitem({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.list({ merchantId: "merchantId", });
await gapi.client.content.orders.refunditem({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.refundorder({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.rejectreturnlineitem({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.returnrefundlineitem({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.setlineitemmetadata({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.shiplineitems({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.updatelineitemshippingdetails({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.updatemerchantorderid({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.orders.updateshipment({ merchantId: "merchantId", orderId: "orderId", });
await gapi.client.content.ordertrackingsignals.create({ merchantId: "merchantId", });
await gapi.client.content.pos.custombatch({ });
await gapi.client.content.pos.delete({ merchantId: "merchantId", storeCode: "storeCode", targetMerchantId: "targetMerchantId", });
await gapi.client.content.pos.get({ merchantId: "merchantId", storeCode: "storeCode", targetMerchantId: "targetMerchantId", });
await gapi.client.content.pos.insert({ merchantId: "merchantId", targetMerchantId: "targetMerchantId", });
await gapi.client.content.pos.inventory({ merchantId: "merchantId", targetMerchantId: "targetMerchantId", });
await gapi.client.content.pos.list({ merchantId: "merchantId", targetMerchantId: "targetMerchantId", });
await gapi.client.content.pos.sale({ merchantId: "merchantId", targetMerchantId: "targetMerchantId", });
await gapi.client.content.productdeliverytime.create({ merchantId: "merchantId", });
await gapi.client.content.productdeliverytime.delete({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.productdeliverytime.get({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.products.custombatch({ });
await gapi.client.content.products.delete({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.products.get({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.products.insert({ merchantId: "merchantId", });
await gapi.client.content.products.list({ merchantId: "merchantId", });
await gapi.client.content.products.update({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.productstatuses.custombatch({ });
await gapi.client.content.productstatuses.get({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.productstatuses.list({ merchantId: "merchantId", });
await gapi.client.content.promotions.create({ merchantId: "merchantId", });
await gapi.client.content.promotions.get({ id: "id", merchantId: "merchantId", });
await gapi.client.content.promotions.list({ merchantId: "merchantId", });
await gapi.client.content.pubsubnotificationsettings.get({ merchantId: "merchantId", });
await gapi.client.content.pubsubnotificationsettings.update({ merchantId: "merchantId", });
await gapi.client.content.quotas.list({ merchantId: "merchantId", });
await gapi.client.content.recommendations.generate({ merchantId: "merchantId", });
await gapi.client.content.recommendations.reportInteraction({ merchantId: "merchantId", });
await gapi.client.content.regionalinventory.custombatch({ });
await gapi.client.content.regionalinventory.insert({ merchantId: "merchantId", productId: "productId", });
await gapi.client.content.regions.create({ merchantId: "merchantId", });
await gapi.client.content.regions.delete({ merchantId: "merchantId", regionId: "regionId", });
await gapi.client.content.regions.get({ merchantId: "merchantId", regionId: "regionId", });
await gapi.client.content.regions.list({ merchantId: "merchantId", });
await gapi.client.content.regions.patch({ merchantId: "merchantId", regionId: "regionId", });
await gapi.client.content.reports.search({ merchantId: "merchantId", });
await gapi.client.content.repricingrules.create({ merchantId: "merchantId", });
await gapi.client.content.repricingrules.delete({ merchantId: "merchantId", ruleId: "ruleId", });
await gapi.client.content.repricingrules.get({ merchantId: "merchantId", ruleId: "ruleId", });
await gapi.client.content.repricingrules.list({ merchantId: "merchantId", });
await gapi.client.content.repricingrules.patch({ merchantId: "merchantId", ruleId: "ruleId", });
await gapi.client.content.returnaddress.custombatch({ });
await gapi.client.content.returnaddress.delete({ merchantId: "merchantId", returnAddressId: "returnAddressId", });
await gapi.client.content.returnaddress.get({ merchantId: "merchantId", returnAddressId: "returnAddressId", });
await gapi.client.content.returnaddress.insert({ merchantId: "merchantId", });
await gapi.client.content.returnaddress.list({ merchantId: "merchantId", });
await gapi.client.content.returnpolicy.custombatch({ });
await gapi.client.content.returnpolicy.delete({ merchantId: "merchantId", returnPolicyId: "returnPolicyId", });
await gapi.client.content.returnpolicy.get({ merchantId: "merchantId", returnPolicyId: "returnPolicyId", });
await gapi.client.content.returnpolicy.insert({ merchantId: "merchantId", });
await gapi.client.content.returnpolicy.list({ merchantId: "merchantId", });
await gapi.client.content.returnpolicyonline.create({ merchantId: "merchantId", });
await gapi.client.content.returnpolicyonline.delete({ merchantId: "merchantId", returnPolicyId: "returnPolicyId", });
await gapi.client.content.returnpolicyonline.get({ merchantId: "merchantId", returnPolicyId: "returnPolicyId", });
await gapi.client.content.returnpolicyonline.list({ merchantId: "merchantId", });
await gapi.client.content.returnpolicyonline.patch({ merchantId: "merchantId", returnPolicyId: "returnPolicyId", });
await gapi.client.content.settlementreports.get({ merchantId: "merchantId", settlementId: "settlementId", });
await gapi.client.content.settlementreports.list({ merchantId: "merchantId", });
await gapi.client.content.settlementtransactions.list({ merchantId: "merchantId", settlementId: "settlementId", });
await gapi.client.content.shippingsettings.custombatch({ });
await gapi.client.content.shippingsettings.get({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.shippingsettings.getsupportedcarriers({ merchantId: "merchantId", });
await gapi.client.content.shippingsettings.getsupportedholidays({ merchantId: "merchantId", });
await gapi.client.content.shippingsettings.getsupportedpickupservices({ merchantId: "merchantId", });
await gapi.client.content.shippingsettings.list({ merchantId: "merchantId", });
await gapi.client.content.shippingsettings.update({ accountId: "accountId", merchantId: "merchantId", });
await gapi.client.content.shoppingadsprogram.get({ merchantId: "merchantId", });
await gapi.client.content.shoppingadsprogram.requestreview({ merchantId: "merchantId", });