How to use where clause in Knex
Create refunds with Stripe
Load HTML with Cheerio
How to send POST request with Axios
Find intersection of array in Lodash
Powered by Official white Bloop logo with a period

Terms / Privacy / Search / Support

  • // 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.labels.create({
        // Required. The merchant the Return Shipping Label belongs to.
        merchantId: 'placeholder-value',
        // Required. Provide the Google-generated merchant order return ID.
        returnId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "carrier": "my_carrier",
          //   "labelUri": "my_labelUri",
          //   "trackingId": "my_trackingId"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "carrier": "my_carrier",
      //   "labelUri": "my_labelUri",
      //   "trackingId": "my_trackingId"
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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;
    });
    
    Docs
  • // 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;
    });
    
    Docs
  • // 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.createorderreturn({
        // The ID of the account that manages the order. This cannot be a multi-client account.
        merchantId: 'placeholder-value',
    
        // Request body metadata
        requestBody: {
          // request body parameters
          // {
          //   "lineItems": [],
          //   "operationId": "my_operationId",
          //   "orderId": "my_orderId",
          //   "returnMethodType": "my_returnMethodType"
          // }
        },
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "executionStatus": "my_executionStatus",
      //   "kind": "my_kind",
      //   "orderReturn": {}
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • // 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.list({
        // Obtains order returns created before this date (inclusively), in ISO 8601 format.
        createdEndDate: 'placeholder-value',
        // Obtains order returns created after this date (inclusively), in ISO 8601 format.
        createdStartDate: 'placeholder-value',
        // The maximum number of order returns to return in the response, used for paging. The default value is 25 returns per page, and the maximum allowed value is 250 returns per page.
        maxResults: 'placeholder-value',
        // The ID of the account that manages the order. This cannot be a multi-client account.
        merchantId: 'placeholder-value',
        // Return the results in the specified order.
        orderBy: 'placeholder-value',
        // The token returned by the previous request.
        pageToken: 'placeholder-value',
      });
      console.log(res.data);
    
      // Example response
      // {
      //   "kind": "my_kind",
      //   "nextPageToken": "my_nextPageToken",
      //   "resources": []
      // }
    }
    
    main().catch(e => {
      console.error(e);
      throw e;
    });
    
    Docs
  • Powered by Official black Bloop logo with a period
    download the IDE extension

    View other examples