2.1.5 • Published 1 year ago

@zuora-sdk/javascript-sdk v2.1.5

Weekly downloads
-
License
Unlicense
Repository
-
Last release
1 year ago

@zuora-sdk/javascript-sdk

@ZuoraSdkJavascriptSdk - JavaScript client for @zuora-sdk/javascript-sdk No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) This SDK is automatically generated by the OpenAPI Generator project:

  • API version: 2022-11-09
  • Package version: 2.1.5
  • Build package: org.openapitools.codegen.languages.JavascriptClientCodegen

Installation

For Node.js

npm

To publish the library as a npm, please follow the procedure in "Publishing npm packages".

Then install it via:

npm install @zuora-sdk/javascript-sdk --save

Finally, you need to build the module:

npm run build
Local development

To use the library locally without publishing to a remote npm registry, first install the dependencies by changing into the directory containing package.json (and this README). Let's call this JAVASCRIPT_CLIENT_DIR. Then run:

npm install

Next, link it globally in npm with the following, also from JAVASCRIPT_CLIENT_DIR:

npm link

To use the link you just defined in your project, switch to the directory you want to use your @zuora-sdk/javascript-sdk from, and run:

npm link /path/to/<JAVASCRIPT_CLIENT_DIR>

Finally, you need to build the module:

npm run build

git

If the library is hosted at a git repository, e.g.https://github.com/GIT_USER_ID/GIT_REPO_ID then install it via:

    npm install GIT_USER_ID/GIT_REPO_ID --save

For browser

The library also works in the browser environment via npm and browserify. After following the above steps with Node.js and installing browserify with npm install -g browserify, perform the following (assuming main.js is your entry file):

browserify main.js > bundle.js

Then include bundle.js in the HTML pages.

Webpack Configuration

Using Webpack you may encounter the following error: "Module not found: Error: Cannot resolve module", most certainly you should disable AMD loader. Add/merge the following section to your webpack config:

module: {
  rules: [
    {
      parser: {
        amd: false
      }
    }
  ]
}

Getting Started

Please follow the installation instruction and execute the following JS code:

var @ZuoraSdkJavascriptSdk = require('@zuora-sdk/javascript-sdk');


var api = new @ZuoraSdkJavascriptSdk.AccountsApi()
var account_create_request = {"name":"Amy Lawrence Account","currency":"USD","bill_to":{"first_name":"Amy","last_name":"Lawrence","address":{"line1":"101 Redwood Shores Parkway","line2":"Suite 1150","city":"Redwood City","state":"California","country":"USA","postal_code":"94065"},"work_phone":"(888) 976-9056","work_email":"amy.lawrence@gmail.com"},"sold_to":{"first_name":"Amy","last_name":"Lawrence","address":{"line1":"101 Redwood Shores Parkway","line2":"","city":"Redwood City","state":"California","country":"USA","postal_code":"94065"},"work_phone":"(888) 976-9056","work_email":"amy.lawrence@gmail.com"},"custom_fields":{"field__c":"custom field value"},"payment_terms":"Due Upon Receipt","tax_certificate":{"start_date":"2022-01-01","end_date":"2023-01-01","state":"pending"},"sequence_set_id":"8f64d4d793733fb0be444ff770a932c7","billing_document_settings":{"additional_email":["jane.doe@gmail.com","james.lawerence@gmail.com"],"email_documents":true}}; // {AccountCreateRequest} 
var opts = {
  'zuora_track_id': "zuora_track_id_example", // {String} A custom identifier for tracking API requests. If you set a value for this header, Zuora returns the same value in the response header. This header enables you to track your API calls to assist with troubleshooting in the event of an issue. The value of this field must use the US-ASCII character set and must not include any of the following characters: colon (:), semicolon (;), double quote (\"), or quote (').
  'async': true, // {Boolean} Making asynchronous requests allows you to scale your applications more efficiently by leveraging Zuora's infrastructure to enqueue and execute requests for you without blocking. These requests also use built-in retry semantics, which makes them much less likely to fail for non-deterministic reasons, even in extreme high-throughput scenarios. Meanwhile, when you send a request to one of these endpoints, you can expect to receive a response in less than 150 milliseconds and these calls are unlikely to trigger rate limit errors. If set to true, Zuora returns a 202 Accepted response, and the response body contains only a request ID.
  'zuora_entity_id': "zuora_entity_id_example", // {String} An entity ID. If you have multi-entity enabled and the authorization token is valid for more than one entity, you must use this header to specify which entity to perform the operation on. If the authorization token is only valid for a single entity, or you do not have multi-entity enabled, you do not need to set this header.
  'idempotency_key': "idempotency_key_example", // {String} Specify a unique idempotency key if you want to perform an idempotent `POST` or `PATCH` request. Do not use this header in other request types. This idempotency key should be a unique value, and the Zuora server identifies subsequent retries of the same request using this value. For more information, see [Idempotent Requests](https://www.zuora.com/developer/v2-api-reference/#tag/Idempotent-Requests).
  'accept_encoding': "accept_encoding_example", // {String} Include a `Accept-Encoding: gzip` header to compress responses, which can reduce the bandwidth required for a response. If specified, Zuora automatically compresses responses that contain over 1000 bytes. For more information about this header, see [Request and Response Compression](https://www.zuora.com/developer/v2-api-reference/#tag/Request-and-Response-Compression).
  'content_encoding': "content_encoding_example" // {String} Include a `Content-Encoding: gzip` header to compress a request. Upload a gzipped file for the payload if you specify this header. For more information, see [Request and Response Compression](https://www.zuora.com/developer/v2-api-reference/#tag/Request-and-Response-Compression).
};
api.createAccount(account_create_request, opts).then(function(data) {
  console.log('API called successfully. Returned data: ' + data);
}, function(error) {
  console.error(error);
});

Documentation for API Endpoints

All URIs are relative to https://rest.sandbox.na.zuora.com/v2

ClassMethodHTTP requestDescription
@ZuoraSdkJavascriptSdk.AccountsApicreateAccountPOST /accountsCreate an account
@ZuoraSdkJavascriptSdk.AccountsApideleteAccountDELETE /accounts/{account_id}Delete an account
@ZuoraSdkJavascriptSdk.AccountsApigetAccountGET /accounts/{account_id}Retrieve an account
@ZuoraSdkJavascriptSdk.AccountsApigetAccountsGET /accountsList all accounts
@ZuoraSdkJavascriptSdk.AccountsApiupdateAccountPATCH /accounts/{account_id}Update an account
@ZuoraSdkJavascriptSdk.BillingDocumentItemsApigetBillingDocumentItemsGET /billing_document_itemsList billing document items
@ZuoraSdkJavascriptSdk.BillingDocumentsApigetBillingDocumentGET /billing_documents/{billing_document_id}Retrieve a billing document
@ZuoraSdkJavascriptSdk.BillingDocumentsApigetBillingDocumentsGET /billing_documentsList all billing documents
@ZuoraSdkJavascriptSdk.BillingDocumentsApipostBillingDocumentPOST /billing_documentsCreate a billing document
@ZuoraSdkJavascriptSdk.ContactsApicreateContactPOST /contactsCreate a contact
@ZuoraSdkJavascriptSdk.ContactsApideleteContactDELETE /contacts/{contact_id}Delete a contact
@ZuoraSdkJavascriptSdk.ContactsApigetContactGET /contacts/{contact_id}Retrieve a contact
@ZuoraSdkJavascriptSdk.ContactsApigetContactsGET /contactsList all contacts
@ZuoraSdkJavascriptSdk.ContactsApiupdateContactPATCH /contacts/{contact_id}Update a contact
@ZuoraSdkJavascriptSdk.CustomObjectsApicreateCustomObjectPOST /custom_objects/{custom_object_type}Create a custom object
@ZuoraSdkJavascriptSdk.CustomObjectsApideleteCustomObjectDELETE /custom_objects/{custom_object_type}/{custom_object_id}Delete a custom object
@ZuoraSdkJavascriptSdk.CustomObjectsApigetCustomObjectGET /custom_objects/{custom_object_type}/{custom_object_id}Retrieve a custom object
@ZuoraSdkJavascriptSdk.CustomObjectsApigetCustomObjectsGET /custom_objects/{custom_object_type}List custom objects
@ZuoraSdkJavascriptSdk.CustomObjectsApiupdateCustomObjectPATCH /custom_objects/{custom_object_type}/{custom_object_id}Update a custom object
@ZuoraSdkJavascriptSdk.PaymentMethodsApicreatePaymentMethodPOST /payment_methodsCreate a payment method
@ZuoraSdkJavascriptSdk.PaymentMethodsApideletePaymentMethodDELETE /payment_methods/{payment_method_id}Delete a payment method
@ZuoraSdkJavascriptSdk.PaymentMethodsApigetPaymentMethodByIdGET /payment_methods/{payment_method_id}Retrieve a payment method
@ZuoraSdkJavascriptSdk.PaymentMethodsApigetPaymentMethodsGET /payment_methodsList all payment methods
@ZuoraSdkJavascriptSdk.PaymentMethodsApiupdatePaymentMethodPATCH /payment_methods/{payment_method_id}Update a payment method
@ZuoraSdkJavascriptSdk.PaymentsApiapplyPaymentPUT /payments/{payment_id}/applyApply a payment
@ZuoraSdkJavascriptSdk.PaymentsApicancelPaymentPOST /payments/{payment_id}/cancelCancel a payment
@ZuoraSdkJavascriptSdk.PaymentsApicreatePaymentPOST /paymentsCreate a payment
@ZuoraSdkJavascriptSdk.PaymentsApigetPaymentGET /payments/{payment_id}Retrieve a payment
@ZuoraSdkJavascriptSdk.PaymentsApigetPaymentsGET /paymentsList all payments
@ZuoraSdkJavascriptSdk.PaymentsApiunapplyPaymentPUT /payments/{payment_id}/unapplyUnapply a payment
@ZuoraSdkJavascriptSdk.PaymentsApiupdatePaymentPATCH /payments/{payment_id}Update a payment
@ZuoraSdkJavascriptSdk.PlansApicreatePlanPOST /plansCreate a plan
@ZuoraSdkJavascriptSdk.PlansApideletePlanDELETE /plans/{plan_id}Delete a plan
@ZuoraSdkJavascriptSdk.PlansApigetPlanGET /plans/{plan_id}Retrieve a plan
@ZuoraSdkJavascriptSdk.PlansApigetPlansGET /plansList all plans
@ZuoraSdkJavascriptSdk.PlansApiupdatePlanPATCH /plans/{plan_id}Update a plan
@ZuoraSdkJavascriptSdk.PricesApicreatePricePOST /pricesCreate a price
@ZuoraSdkJavascriptSdk.PricesApideletePriceDELETE /prices/{price_id}Delete a price
@ZuoraSdkJavascriptSdk.PricesApigetPriceGET /prices/{price_id}Retrieve a price
@ZuoraSdkJavascriptSdk.PricesApigetPricesGET /pricesList all prices
@ZuoraSdkJavascriptSdk.PricesApipatchPricePATCH /prices/{price_id}Update a price
@ZuoraSdkJavascriptSdk.ProductsApicreateProductPOST /productsCreate a product
@ZuoraSdkJavascriptSdk.ProductsApideleteProductDELETE /products/{product_id}Delete a product
@ZuoraSdkJavascriptSdk.ProductsApigetProductGET /products/{product_id}Retrieve a product
@ZuoraSdkJavascriptSdk.ProductsApigetProductsGET /productsList all products
@ZuoraSdkJavascriptSdk.ProductsApiupdateProductPATCH /products/{product_id}Update a product
@ZuoraSdkJavascriptSdk.RefundsApicreateRefundPOST /refundsCreate a refund
@ZuoraSdkJavascriptSdk.RefundsApigetRefundGET /refunds/{refund_id}Retrieve a refund
@ZuoraSdkJavascriptSdk.RefundsApigetRefundsGET /refundsList all refunds
@ZuoraSdkJavascriptSdk.RefundsApiupdateRefundPATCH /refunds/{refund_id}Update a refund
@ZuoraSdkJavascriptSdk.SubscriptionItemsApigetSubscriptionItemsGET /subscription_itemsList all subscription items
@ZuoraSdkJavascriptSdk.SubscriptionPlansApigetSubscriptionPlanGET /subscription_plans/{subscription_plan_id}Retrieve a subscription plan
@ZuoraSdkJavascriptSdk.SubscriptionPlansApigetSubscriptionPlansGET /subscription_plansList all subscription plans
@ZuoraSdkJavascriptSdk.SubscriptionsApiactivateSubscriptionPOST /subscriptions/{subscription_id}/activateActivate a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApicancelSubscriptionPOST /subscriptions/{subscription_id}/cancelCancel a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApicreateSubscriptionPOST /subscriptionsCreate a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApigetSubscriptionByKeyGET /subscriptions/{subscription_id}Retrieve a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApigetSubscriptionsGET /subscriptionsList all subscriptions
@ZuoraSdkJavascriptSdk.SubscriptionsApipatchSubscriptionPATCH /subscriptions/{subscription_id}Update a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApipauseSubscriptionPOST /subscriptions/{subscription_id}/pausePause a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApipreviewSubscriptionPOST /subscriptions/previewPreview a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApiresumeSubscriptionPOST /subscriptions/{subscription_id}/resumeResume a subscription
@ZuoraSdkJavascriptSdk.SubscriptionsApiuncancelSubscriptionPOST /subscriptions/{subscription_id}/keepUncancel a subscription
@ZuoraSdkJavascriptSdk.WorkflowsApirunWorkflowPOST /workflows/{workflow_id}/runRun a workflow

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization.

2.1.5

1 year ago

2.1.4

1 year ago

2.1.3

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

2 years ago

2.0.9

2 years ago

2.0.8

2 years ago

2.0.7

2 years ago

2.0.6

2 years ago

2.0.5

2 years ago

2.0.4

2 years ago

2.0.3

2 years ago

2.0.2

2 years ago

2.0.1

2 years ago

2.0.0

2 years ago