1.0.6 • Published 1 year ago

anton-pws v1.0.6

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

anton-pws

Example NodeJS SDK for Autodesk PWS.

Initializing the Client

  1. Obtain your credentials from the Partner Developer Portal. This includes your:
    • consumerSecret (obtained within an app you create in the Portal)
    • consumerKey (obtained within an app you create in the Portal)
    • csn (obtained from the Portal when logged in)
  2. You must initialize a PWS client to use all SDK functionality. This can be done by calling the PWS function and passing in your credentials.
const client = PWS(consumerKey, consumerSecret, csn);

Placing an Initial Order

You can use the fulfillment module to place an initial order:

const order = await client.orders.v1.fulfillment.placeInitialOrder(InitialOrder, callbackUrl, environmentUrl);

API reference documentation can be found here.

Getting an Order Status

You can use the status module to retrieve an order status:

const status = await client.orders.v1.status.get(transactionId, callbackUrl, environmentUrl);

API reference documentation can be found here.

Models

An InitialOrder has the following JSON structure ('?' denotes optional property):

{
    "endCustomerAccount": "{Account}",
    "endCustomerContractManager": "{Contact}",
    "shipTo": "{Account}",
    "reseller": "string",
    "soldTo": "string",
    "governmentEntity": "string?",
    "poNumber": "string",
    "customerPoNumber": "string?",
    "contractStartDate": "string?",
    "priceDate": "string?",
    "items": "[InitialProduct]",
    "discounts": "[Discount]"
}

An Account has the following JSON structure ('?' denotes optional property):

{
    "csn": "string?",
    "name": "string?",
    "altName": "string?",
    "addressLine1": "string?",
    "addressLine2": "string?",
    "addressLine3": "string?",
    "city": "string?",
    "postalCode": "string?",
    "stateProvinceCode": "string?",
    "countryCode": "string?",
    "phoneNumber": "string?"
}

A Contact has the following JSON structure ('?' denotes optional property):

{
    "firstName": "string",
    "lastName": "string",
    "email": "string",
    "countryCode": "string?",
    "language": "string?"
}

An InitialProduct has the following JSON structure ('?' denotes optional property):

{
    "partNumber": "string",
    "partnerSubscriptionId": "string?",
    "quantity": 2
}

A Discount has the following JSON structure ('?' denotes optional property):

{
    "discountId": "string",
    "discountType": "{DiscountType}"
}

The DiscountType enum has the following possible values: DDA

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago

0.2.3

1 year ago

0.2.2

1 year ago

0.2.1

1 year ago

0.2.0

1 year ago

0.1.9

1 year ago

0.1.8

1 year ago

0.1.7

1 year ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.4

1 year ago

0.1.3

1 year ago

0.1.2

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago

0.0.0

1 year ago