diff --git a/CHANGES.md b/CHANGES.md index 7c5dabc..cd2817f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,27 @@ # Change Log +## Version 4.20200812.2 (2020-08-12T00:00) +## API releases +* Subscriptions API (beta): + * For an overview, see [Square Subscriptions.](https://developer.squareup.com/docs/subscriptions/overview) + * For technical reference, see [Subscriptions API.](https://developer.squareup.com/reference/square_2020-08-12/subscriptions-api) + +## Existing API updates +* Catalog API + * [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2020-08-12/objects/CatalogSubscriptionPlan) (beta). This catalog type is added in support of the Subscriptions API. Subscription plans are stored as catalog object of the `SUBSCRIPTION_PLAN` type. For more information, see [Set Up and Manage a Subscription Plan.](https://developer.squareup.com/docs/subscriptions-api/setup-plan) + +## SqPaymentForm SDK updates +* [SqPaymentForm.masterpassImageURL.](https://developer.squareup.com/docs/api/paymentform#masterpassimageurl) This function is updated to return a Secure Remote Commerce background image URL. + +## Documentation updates +* Locations API + * [About the main location.](https://developer.squareup.com/docs/locations-api#about-the-main-location) Added clarifying information about the main location concept. +* OAuth API + * [Migrate to the Square API OAuth Flow.](https://developer.squareup.com/docs/oauth-api/migrate-to-square-oauth-flow) Added a new topic to document migration from a v1 location-scoped OAuth access token to the Square seller-scoped OAuth access token. +* Payment Form SDK + * Renamed the Add a Masterpass Button topic to [Add a Secure Remote Commerce Button.](https://developer.squareup.com/docs/payment-form/add-digital-wallets/masterpass) Updated the instructions to add a Secure Remote Commerce button to replace a legacy Masterpass button. + * [Payment form technical reference.](https://developer.squareup.com/docs/api/paymentform) Updated the reference to show code examples for adding a Secure Remote Commerce button. + ## Version 4.20200722.1 (2020-07-22T00:00) ## API releases diff --git a/README.md b/README.md index 6644956..8478a5a 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,12 @@ Class | Method | HTTP request | Description *SquareConnect.RefundsApi* | [**refundPayment**](docs/RefundsApi.md#refundPayment) | **POST** /v2/refunds | RefundPayment *SquareConnect.ReportingApi* | [**listAdditionalRecipientReceivableRefunds**](docs/ReportingApi.md#listAdditionalRecipientReceivableRefunds) | **GET** /v2/locations/{location_id}/additional-recipient-receivable-refunds | ListAdditionalRecipientReceivableRefunds *SquareConnect.ReportingApi* | [**listAdditionalRecipientReceivables**](docs/ReportingApi.md#listAdditionalRecipientReceivables) | **GET** /v2/locations/{location_id}/additional-recipient-receivables | ListAdditionalRecipientReceivables +*SquareConnect.SubscriptionsApi* | [**cancelSubscription**](docs/SubscriptionsApi.md#cancelSubscription) | **POST** /v2/subscriptions/{subscription_id}/cancel | CancelSubscription +*SquareConnect.SubscriptionsApi* | [**createSubscription**](docs/SubscriptionsApi.md#createSubscription) | **POST** /v2/subscriptions | CreateSubscription +*SquareConnect.SubscriptionsApi* | [**listSubscriptionEvents**](docs/SubscriptionsApi.md#listSubscriptionEvents) | **GET** /v2/subscriptions/{subscription_id}/events | ListSubscriptionEvents +*SquareConnect.SubscriptionsApi* | [**retrieveSubscription**](docs/SubscriptionsApi.md#retrieveSubscription) | **GET** /v2/subscriptions/{subscription_id} | RetrieveSubscription +*SquareConnect.SubscriptionsApi* | [**searchSubscriptions**](docs/SubscriptionsApi.md#searchSubscriptions) | **POST** /v2/subscriptions/search | SearchSubscriptions +*SquareConnect.SubscriptionsApi* | [**updateSubscription**](docs/SubscriptionsApi.md#updateSubscription) | **PUT** /v2/subscriptions/{subscription_id} | UpdateSubscription *SquareConnect.TeamApi* | [**bulkCreateTeamMembers**](docs/TeamApi.md#bulkCreateTeamMembers) | **POST** /v2/team-members/bulk-create | BulkCreateTeamMembers *SquareConnect.TeamApi* | [**bulkUpdateTeamMembers**](docs/TeamApi.md#bulkUpdateTeamMembers) | **POST** /v2/team-members/bulk-update | BulkUpdateTeamMembers *SquareConnect.TeamApi* | [**createTeamMember**](docs/TeamApi.md#createTeamMember) | **POST** /v2/team-members | CreateTeamMember @@ -335,6 +341,8 @@ Class | Method | HTTP request | Description - [SquareConnect.CancelPaymentByIdempotencyKeyResponse](docs/CancelPaymentByIdempotencyKeyResponse.md) - [SquareConnect.CancelPaymentRequest](docs/CancelPaymentRequest.md) - [SquareConnect.CancelPaymentResponse](docs/CancelPaymentResponse.md) + - [SquareConnect.CancelSubscriptionRequest](docs/CancelSubscriptionRequest.md) + - [SquareConnect.CancelSubscriptionResponse](docs/CancelSubscriptionResponse.md) - [SquareConnect.CancelTerminalCheckoutRequest](docs/CancelTerminalCheckoutRequest.md) - [SquareConnect.CancelTerminalCheckoutResponse](docs/CancelTerminalCheckoutResponse.md) - [SquareConnect.CaptureTransactionRequest](docs/CaptureTransactionRequest.md) @@ -401,6 +409,7 @@ Class | Method | HTTP request | Description - [SquareConnect.CatalogQuickAmountType](docs/CatalogQuickAmountType.md) - [SquareConnect.CatalogQuickAmountsSettings](docs/CatalogQuickAmountsSettings.md) - [SquareConnect.CatalogQuickAmountsSettingsOption](docs/CatalogQuickAmountsSettingsOption.md) + - [SquareConnect.CatalogSubscriptionPlan](docs/CatalogSubscriptionPlan.md) - [SquareConnect.CatalogTax](docs/CatalogTax.md) - [SquareConnect.CatalogTimePeriod](docs/CatalogTimePeriod.md) - [SquareConnect.CatalogV1Id](docs/CatalogV1Id.md) @@ -448,6 +457,8 @@ Class | Method | HTTP request | Description - [SquareConnect.CreateRefundResponse](docs/CreateRefundResponse.md) - [SquareConnect.CreateShiftRequest](docs/CreateShiftRequest.md) - [SquareConnect.CreateShiftResponse](docs/CreateShiftResponse.md) + - [SquareConnect.CreateSubscriptionRequest](docs/CreateSubscriptionRequest.md) + - [SquareConnect.CreateSubscriptionResponse](docs/CreateSubscriptionResponse.md) - [SquareConnect.CreateTeamMemberRequest](docs/CreateTeamMemberRequest.md) - [SquareConnect.CreateTeamMemberResponse](docs/CreateTeamMemberResponse.md) - [SquareConnect.CreateTerminalCheckoutRequest](docs/CreateTerminalCheckoutRequest.md) @@ -593,6 +604,8 @@ Class | Method | HTTP request | Description - [SquareConnect.ListPaymentsResponse](docs/ListPaymentsResponse.md) - [SquareConnect.ListRefundsRequest](docs/ListRefundsRequest.md) - [SquareConnect.ListRefundsResponse](docs/ListRefundsResponse.md) + - [SquareConnect.ListSubscriptionEventsRequest](docs/ListSubscriptionEventsRequest.md) + - [SquareConnect.ListSubscriptionEventsResponse](docs/ListSubscriptionEventsResponse.md) - [SquareConnect.ListTransactionsRequest](docs/ListTransactionsRequest.md) - [SquareConnect.ListTransactionsResponse](docs/ListTransactionsResponse.md) - [SquareConnect.ListWorkweekConfigsRequest](docs/ListWorkweekConfigsRequest.md) @@ -749,6 +762,8 @@ Class | Method | HTTP request | Description - [SquareConnect.RetrieveLoyaltyRewardResponse](docs/RetrieveLoyaltyRewardResponse.md) - [SquareConnect.RetrieveMerchantRequest](docs/RetrieveMerchantRequest.md) - [SquareConnect.RetrieveMerchantResponse](docs/RetrieveMerchantResponse.md) + - [SquareConnect.RetrieveSubscriptionRequest](docs/RetrieveSubscriptionRequest.md) + - [SquareConnect.RetrieveSubscriptionResponse](docs/RetrieveSubscriptionResponse.md) - [SquareConnect.RetrieveTeamMemberRequest](docs/RetrieveTeamMemberRequest.md) - [SquareConnect.RetrieveTeamMemberResponse](docs/RetrieveTeamMemberResponse.md) - [SquareConnect.RetrieveTransactionRequest](docs/RetrieveTransactionRequest.md) @@ -787,6 +802,10 @@ Class | Method | HTTP request | Description - [SquareConnect.SearchOrdersStateFilter](docs/SearchOrdersStateFilter.md) - [SquareConnect.SearchShiftsRequest](docs/SearchShiftsRequest.md) - [SquareConnect.SearchShiftsResponse](docs/SearchShiftsResponse.md) + - [SquareConnect.SearchSubscriptionsFilter](docs/SearchSubscriptionsFilter.md) + - [SquareConnect.SearchSubscriptionsQuery](docs/SearchSubscriptionsQuery.md) + - [SquareConnect.SearchSubscriptionsRequest](docs/SearchSubscriptionsRequest.md) + - [SquareConnect.SearchSubscriptionsResponse](docs/SearchSubscriptionsResponse.md) - [SquareConnect.SearchTeamMembersFilter](docs/SearchTeamMembersFilter.md) - [SquareConnect.SearchTeamMembersQuery](docs/SearchTeamMembersQuery.md) - [SquareConnect.SearchTeamMembersRequest](docs/SearchTeamMembersRequest.md) @@ -809,6 +828,12 @@ Class | Method | HTTP request | Description - [SquareConnect.StandardUnitDescriptionGroup](docs/StandardUnitDescriptionGroup.md) - [SquareConnect.SubmitEvidenceRequest](docs/SubmitEvidenceRequest.md) - [SquareConnect.SubmitEvidenceResponse](docs/SubmitEvidenceResponse.md) + - [SquareConnect.Subscription](docs/Subscription.md) + - [SquareConnect.SubscriptionCadence](docs/SubscriptionCadence.md) + - [SquareConnect.SubscriptionEvent](docs/SubscriptionEvent.md) + - [SquareConnect.SubscriptionEventSubscriptionEventType](docs/SubscriptionEventSubscriptionEventType.md) + - [SquareConnect.SubscriptionPhase](docs/SubscriptionPhase.md) + - [SquareConnect.SubscriptionStatus](docs/SubscriptionStatus.md) - [SquareConnect.TaxCalculationPhase](docs/TaxCalculationPhase.md) - [SquareConnect.TaxInclusionType](docs/TaxInclusionType.md) - [SquareConnect.TeamMember](docs/TeamMember.md) @@ -848,6 +873,8 @@ Class | Method | HTTP request | Description - [SquareConnect.UpdateOrderResponse](docs/UpdateOrderResponse.md) - [SquareConnect.UpdateShiftRequest](docs/UpdateShiftRequest.md) - [SquareConnect.UpdateShiftResponse](docs/UpdateShiftResponse.md) + - [SquareConnect.UpdateSubscriptionRequest](docs/UpdateSubscriptionRequest.md) + - [SquareConnect.UpdateSubscriptionResponse](docs/UpdateSubscriptionResponse.md) - [SquareConnect.UpdateTeamMemberRequest](docs/UpdateTeamMemberRequest.md) - [SquareConnect.UpdateTeamMemberResponse](docs/UpdateTeamMemberResponse.md) - [SquareConnect.UpdateWageSettingRequest](docs/UpdateWageSettingRequest.md) diff --git a/docs/CancelSubscriptionRequest.md b/docs/CancelSubscriptionRequest.md new file mode 100644 index 0000000..7b35de7 --- /dev/null +++ b/docs/CancelSubscriptionRequest.md @@ -0,0 +1,12 @@ +# SquareConnect.CancelSubscriptionRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/CancelSubscriptionResponse.md b/docs/CancelSubscriptionResponse.md new file mode 100644 index 0000000..e2e507d --- /dev/null +++ b/docs/CancelSubscriptionResponse.md @@ -0,0 +1,14 @@ +# SquareConnect.CancelSubscriptionResponse + +### Description +**Note: This model is in beta.** + +Defines fields that are included in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) response. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscription** | [**Subscription**](Subscription.md) | The canceled subscription. | [optional] + + diff --git a/docs/CatalogObject.md b/docs/CatalogObject.md index 8bd6756..ef8d658 100644 --- a/docs/CatalogObject.md +++ b/docs/CatalogObject.md @@ -2,7 +2,7 @@ ### Description -The wrapper object for the Catalog entries of a given object type. The type of a particular `CatalogObject` is determined by the value of the `type` attribute and only the corresponding data attribute can be set on the `CatalogObject` instance. For example, the following list shows some instances of `CatalogObject` of a given `type` and their corresponding data atrribute that can be set: - For a `CatalogObject` of the `ITEM` type, set the `item_data` attribute to yield the `CatalogItem` object. - For a `CatalogObject` of the `ITEM_VARIATION` type, set the `item_variation_data` attribute to yield the `CatalogItemVariation` object. - For a `CatalogObject` of the `MODIFIER` type, set the `modifier_data` attribute to yield the `CatalogModifier` object. - For a `CatalogObject` of the `MODIFIER_LIST` type, set the `modifier_list_data` attribute to yield the `CatalogModifierList` object. - For a `CatalogObject` of the `CATEGORY` type, set the `category_data` attribute to yield the `CatalogCategory` object. - For a `CatalogObject` of the `DISCOUNT` type, set the `discount_data` attribute to yield the `CatalogDiscount` object. - For a `CatalogObject` of the `TAX` type, set the `tax_data` attribute to yield the `CatalogTax` object. - For a `CatalogObject` of the `IMAGE` type, set the `image_data` attribute to yield the `CatalogImageData` object. - For a `CatalogObject` of the `QUICK_AMOUNTS_SETTINGS` type, set the `quick_amounts_settings_data` attribute to yield the `CatalogQuickAmountsSettings` object. - For a `CatalogObject` of the `PRICING_RULE` type, set the `pricing_rule_data` attribute to yield the `CatalogPricingRule` object. - For a `CatalogObject` of the `TIME_PERIOD` type, set the `time_period_data` attribute to yield the `CatalogTimePeriod` object. - For a `CatalogObject` of the `PRODUCT_SET` type, set the `product_set_data` attribute to yield the `CatalogProductSet` object. For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide. +The wrapper object for the Catalog entries of a given object type. The type of a particular `CatalogObject` is determined by the value of the `type` attribute and only the corresponding data attribute can be set on the `CatalogObject` instance. For example, the following list shows some instances of `CatalogObject` of a given `type` and their corresponding data atrribute that can be set: - For a `CatalogObject` of the `ITEM` type, set the `item_data` attribute to yield the `CatalogItem` object. - For a `CatalogObject` of the `ITEM_VARIATION` type, set the `item_variation_data` attribute to yield the `CatalogItemVariation` object. - For a `CatalogObject` of the `MODIFIER` type, set the `modifier_data` attribute to yield the `CatalogModifier` object. - For a `CatalogObject` of the `MODIFIER_LIST` type, set the `modifier_list_data` attribute to yield the `CatalogModifierList` object. - For a `CatalogObject` of the `CATEGORY` type, set the `category_data` attribute to yield the `CatalogCategory` object. - For a `CatalogObject` of the `DISCOUNT` type, set the `discount_data` attribute to yield the `CatalogDiscount` object. - For a `CatalogObject` of the `TAX` type, set the `tax_data` attribute to yield the `CatalogTax` object. - For a `CatalogObject` of the `IMAGE` type, set the `image_data` attribute to yield the `CatalogImageData` object. - For a `CatalogObject` of the `QUICK_AMOUNTS_SETTINGS` type, set the `quick_amounts_settings_data` attribute to yield the `CatalogQuickAmountsSettings` object. - For a `CatalogObject` of the `PRICING_RULE` type, set the `pricing_rule_data` attribute to yield the `CatalogPricingRule` object. - For a `CatalogObject` of the `TIME_PERIOD` type, set the `time_period_data` attribute to yield the `CatalogTimePeriod` object. - For a `CatalogObject` of the `PRODUCT_SET` type, set the `product_set_data` attribute to yield the `CatalogProductSet` object. - For a `CatalogObject` of the `SUBSCRIPTION_PLAN` type, set the `subscription_plan_data` attribute to yield the `CatalogSubscriptionPlan` object. For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide. ## Properties Name | Type | Description | Notes @@ -30,6 +30,7 @@ Name | Type | Description | Notes **pricing_rule_data** | [**CatalogPricingRule**](CatalogPricingRule.md) | Structured data for a `CatalogPricingRule`, set for CatalogObjects of type `PRICING_RULE`. A `CatalogPricingRule` object often works with a `CatalogProductSet` object or a `CatalogTimePeriod` object. | [optional] **image_data** | [**CatalogImage**](CatalogImage.md) | Structured data for a `CatalogImage`, set for CatalogObjects of type `IMAGE`. | [optional] **measurement_unit_data** | [**CatalogMeasurementUnit**](CatalogMeasurementUnit.md) | Structured data for a `CatalogMeasurementUnit`, set for CatalogObjects of type `MEASUREMENT_UNIT`. | [optional] +**subscription_plan_data** | [**CatalogSubscriptionPlan**](CatalogSubscriptionPlan.md) | Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`. | [optional] **item_option_data** | [**CatalogItemOption**](CatalogItemOption.md) | Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`. | [optional] **item_option_value_data** | [**CatalogItemOptionValue**](CatalogItemOptionValue.md) | Structured data for a `CatalogItemOptionValue`, set for CatalogObjects of type `ITEM_OPTION_VAL`. | [optional] **custom_attribute_definition_data** | [**CatalogCustomAttributeDefinition**](CatalogCustomAttributeDefinition.md) | Structured data for a `CatalogCustomAttributeDefinition`, set for CatalogObjects of type `CUSTOM_ATTRIBUTE_DEFINITION`. | [optional] diff --git a/docs/CatalogObjectType.md b/docs/CatalogObjectType.md index bf77124..c7f66e5 100644 --- a/docs/CatalogObjectType.md +++ b/docs/CatalogObjectType.md @@ -27,6 +27,8 @@ * `MEASUREMENT_UNIT` (value: `"MEASUREMENT_UNIT"`) +* `SUBSCRIPTION_PLAN` (value: `"SUBSCRIPTION_PLAN"`) + * `ITEM_OPTION` (value: `"ITEM_OPTION"`) * `ITEM_OPTION_VAL` (value: `"ITEM_OPTION_VAL"`) diff --git a/docs/CatalogSubscriptionPlan.md b/docs/CatalogSubscriptionPlan.md new file mode 100644 index 0000000..fa2ecc7 --- /dev/null +++ b/docs/CatalogSubscriptionPlan.md @@ -0,0 +1,14 @@ +# SquareConnect.CatalogSubscriptionPlan + +### Description +**Note: This model is in beta.** + +Describes a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **String** | The name of the plan. | [optional] +**phases** | [**[SubscriptionPhase]**](SubscriptionPhase.md) | A list of SubscriptionPhase containing the `SubscriptionPhase` for this plan. | [optional] + + diff --git a/docs/CreateSubscriptionRequest.md b/docs/CreateSubscriptionRequest.md new file mode 100644 index 0000000..0743023 --- /dev/null +++ b/docs/CreateSubscriptionRequest.md @@ -0,0 +1,22 @@ +# SquareConnect.CreateSubscriptionRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**idempotency_key** | **String** | A unique string that identifies this `CreateSubscription` request. If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see [Idempotency keys](https://developer.squareup.com/docs/docs/working-with-apis/idempotency). | +**location_id** | **String** | The ID of the location the subscription is associated with. | +**plan_id** | **String** | The ID of the subscription plan. For more information, see [Subscription Plan Overview](https://developer.squareup.com/docs/docs/subscriptions/overview). | +**customer_id** | **String** | The ID of the `customer` profile. | +**start_date** | **String** | The start date of the subscription, in YYYY-MM-DD format. For example, 2013-01-15. If the start date is left empty, the subscription begins immediately. | [optional] +**canceled_date** | **String** | The date when the subscription should be canceled, in YYYY-MM-DD format (for example, 2025-02-29). This overrides the plan configuration if it comes before the date the subscription would otherwise end. | [optional] +**tax_percentage** | **String** | The tax to add when billing the subscription. The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. For example, a value of 7.5 corresponds to 7.5%. | [optional] +**price_override_money** | [**Money**](Money.md) | A custom price to apply for the subscription. If specified, it overrides the price configured by the subscription plan. | [optional] +**card_id** | **String** | The ID of the `customer](#type-customer) [card` to charge. If not specified, Square sends an invoice via email. For an example to create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/docs/subscriptions-api/walkthrough). | [optional] +**timezone** | **String** | The timezone that is used in date calculations for the subscription. If unset, defaults to the location timezone. If a timezone is not configured for the location, defaults to \"America/New_York\". Format: the IANA Timezone Database identifier for the location timezone. For a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). | [optional] + + diff --git a/docs/CreateSubscriptionResponse.md b/docs/CreateSubscriptionResponse.md new file mode 100644 index 0000000..72b6f1c --- /dev/null +++ b/docs/CreateSubscriptionResponse.md @@ -0,0 +1,14 @@ +# SquareConnect.CreateSubscriptionResponse + +### Description +**Note: This model is in beta.** + +Defines the fields that are included in the response from the [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscription** | [**Subscription**](Subscription.md) | The newly created subscription. For more information, see [Subscription object](https://developer.squareup.com/docs/docs/subscriptions-api/overview#subscription-object). | [optional] + + diff --git a/docs/ListSubscriptionEventsRequest.md b/docs/ListSubscriptionEventsRequest.md new file mode 100644 index 0000000..9069595 --- /dev/null +++ b/docs/ListSubscriptionEventsRequest.md @@ -0,0 +1,14 @@ +# SquareConnect.ListSubscriptionEventsRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cursor** | **String** | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). | [optional] +**limit** | **Number** | The upper limit on the number of subscription events to return in the response. Default: `200` | [optional] + + diff --git a/docs/ListSubscriptionEventsResponse.md b/docs/ListSubscriptionEventsResponse.md new file mode 100644 index 0000000..21ae9af --- /dev/null +++ b/docs/ListSubscriptionEventsResponse.md @@ -0,0 +1,15 @@ +# SquareConnect.ListSubscriptionEventsResponse + +### Description +**Note: This model is in beta.** + +Defines the fields that are included in the response from the [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscription_events** | [**[SubscriptionEvent]**](SubscriptionEvent.md) | The `SubscriptionEvents` retrieved. | [optional] +**cursor** | **String** | When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of events. If empty, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). | [optional] + + diff --git a/docs/PaymentsApi.md b/docs/PaymentsApi.md index 5c7e228..e04067b 100644 --- a/docs/PaymentsApi.md +++ b/docs/PaymentsApi.md @@ -110,7 +110,7 @@ Name | Type | Description | Notes # **completePayment** -> CompletePaymentResponse completePayment(paymentId, body) +> CompletePaymentResponse completePayment(paymentId) CompletePayment @@ -129,9 +129,7 @@ var apiInstance = new SquareConnect.PaymentsApi(); var paymentId = "paymentId_example"; // String | Unique ID identifying the payment to be completed. -var body = new SquareConnect.CompletePaymentRequest(); // CompletePaymentRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. - -apiInstance.completePayment(paymentId, body).then(function(data) { +apiInstance.completePayment(paymentId).then(function(data) { console.log('API called successfully. Returned data: ' + data); }, function(error) { console.error(error); @@ -144,7 +142,6 @@ apiInstance.completePayment(paymentId, body).then(function(data) { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **paymentId** | **String**| Unique ID identifying the payment to be completed. | - **body** | [**CompletePaymentRequest**](CompletePaymentRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | ### Return type diff --git a/docs/RetrieveSubscriptionRequest.md b/docs/RetrieveSubscriptionRequest.md new file mode 100644 index 0000000..ef10be5 --- /dev/null +++ b/docs/RetrieveSubscriptionRequest.md @@ -0,0 +1,12 @@ +# SquareConnect.RetrieveSubscriptionRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- + + diff --git a/docs/RetrieveSubscriptionResponse.md b/docs/RetrieveSubscriptionResponse.md new file mode 100644 index 0000000..6a11be2 --- /dev/null +++ b/docs/RetrieveSubscriptionResponse.md @@ -0,0 +1,14 @@ +# SquareConnect.RetrieveSubscriptionResponse + +### Description +**Note: This model is in beta.** + +Defines the fields that are included in the response from the [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscription** | [**Subscription**](Subscription.md) | The subscription retrieved. | [optional] + + diff --git a/docs/SearchSubscriptionsFilter.md b/docs/SearchSubscriptionsFilter.md new file mode 100644 index 0000000..85699c5 --- /dev/null +++ b/docs/SearchSubscriptionsFilter.md @@ -0,0 +1,14 @@ +# SquareConnect.SearchSubscriptionsFilter + +### Description +**Note: This model is in beta.** + +Represents a set of SearchSubscriptionsQuery filters used to limit the set of Subscriptions returned by SearchSubscriptions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**customer_ids** | **[String]** | A filter to select subscriptions based on the customer. | [optional] +**location_ids** | **[String]** | A filter to select subscriptions based the location. | [optional] + + diff --git a/docs/SearchSubscriptionsQuery.md b/docs/SearchSubscriptionsQuery.md new file mode 100644 index 0000000..ab415ed --- /dev/null +++ b/docs/SearchSubscriptionsQuery.md @@ -0,0 +1,13 @@ +# SquareConnect.SearchSubscriptionsQuery + +### Description +**Note: This model is in beta.** + +Represents a query (including filtering criteria) used to search for subscriptions. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**filter** | [**SearchSubscriptionsFilter**](SearchSubscriptionsFilter.md) | A list of filtering criteria. | [optional] + + diff --git a/docs/SearchSubscriptionsRequest.md b/docs/SearchSubscriptionsRequest.md new file mode 100644 index 0000000..a6968e1 --- /dev/null +++ b/docs/SearchSubscriptionsRequest.md @@ -0,0 +1,15 @@ +# SquareConnect.SearchSubscriptionsRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**cursor** | **String** | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). | [optional] +**limit** | **Number** | The upper limit on the number of subscriptions to return in the response. Default: `200` | [optional] +**query** | [**SearchSubscriptionsQuery**](SearchSubscriptionsQuery.md) | Query subscriptions based on the given conditions and sort order. Calling SearchSubscriptions without an explicit query parameter will return all subscriptions. | [optional] + + diff --git a/docs/SearchSubscriptionsResponse.md b/docs/SearchSubscriptionsResponse.md new file mode 100644 index 0000000..564f15b --- /dev/null +++ b/docs/SearchSubscriptionsResponse.md @@ -0,0 +1,15 @@ +# SquareConnect.SearchSubscriptionsResponse + +### Description +**Note: This model is in beta.** + +Defines the fields that are included in the response from the [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscriptions** | [**[Subscription]**](Subscription.md) | The search result. | [optional] +**cursor** | **String** | When a response is truncated, it includes a cursor that you can use in a subsequent request to fetch the next set of subscriptions. If empty, this is the final response. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). | [optional] + + diff --git a/docs/Subscription.md b/docs/Subscription.md new file mode 100644 index 0000000..079821f --- /dev/null +++ b/docs/Subscription.md @@ -0,0 +1,27 @@ +# SquareConnect.Subscription + +### Description +**Note: This model is in beta.** + +Represents a customer subscription to a subscription plan. For an overview of the `Subscription` type, see [Subscription object](/docs/subscriptions-api/overview#subscription-object-overview). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The Square-assigned ID of the subscription. | [optional] +**location_id** | **String** | The ID of the location associated with the subscription. | [optional] +**plan_id** | **String** | The ID of the associated `subscription plan`. | [optional] +**customer_id** | **String** | The ID of the associated `customer` profile. | [optional] +**start_date** | **String** | The start date of the subscription, in YYYY-MM-DD format (for example, 2013-01-15). | [optional] +**canceled_date** | **String** | The subscription cancellation date, in YYYY-MM-DD format (for example, 2013-01-15). On this date, the subscription status changes to `CANCELED` and the subscription billing stops. If you don't set this field, the subscription plan dictates if and when subscription ends. You cannot update this field, you can only clear it. | [optional] +**status** | **String** | The current status of the subscription. See [SubscriptionStatus](#type-subscriptionstatus) for possible values | [optional] +**tax_percentage** | **String** | The tax amount applied when billing the subscription. The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. For example, a value of `7.5` corresponds to 7.5%. | [optional] +**invoice_ids** | **[String]** | The IDs of the `invoices` created for the subscription, listed in order when the invoices were created (oldest invoices appear first). | [optional] +**price_override_money** | [**Money**](Money.md) | A custom price to apply for the subscription. If specified, it overrides the price configured by the subscription plan. | [optional] +**version** | **Number** | The version of the object. When updating an object, the version supplied must match the version in the database, otherwise the write will be rejected as conflicting. | [optional] +**created_at** | **String** | The timestamp when the subscription was created, in RFC 3339 format. | [optional] +**card_id** | **String** | The ID of the `customer](#type-customer) [card` that is charged for the subscription. | [optional] +**paid_until_date** | **String** | The date up to which the customer is invoiced for the subscription, in YYYY-MM-DD format (for example, 2013-01-15). After the invoice is paid for a given billing period, this date will be the last day of the billing period. For example, suppose for the month of May a customer gets an invoice (or charged the card) on May 1. For the monthly billing scenario, this date is then set to May 31. | [optional] +**timezone** | **String** | Timezone that will be used in date calculations for the subscription. Defaults to the timezone of the location based on `location_id`. Format: the IANA Timezone Database identifier for the location timezone (for example, `America/Los_Angeles`). | [optional] + + diff --git a/docs/SubscriptionCadence.md b/docs/SubscriptionCadence.md new file mode 100644 index 0000000..a55a0af --- /dev/null +++ b/docs/SubscriptionCadence.md @@ -0,0 +1,32 @@ +# SquareConnect.SubscriptionCadence + +## Enum + + +* `DAILY` (value: `"DAILY"`) + +* `WEEKLY` (value: `"WEEKLY"`) + +* `EVERY_TWO_WEEKS` (value: `"EVERY_TWO_WEEKS"`) + +* `THIRTY_DAYS` (value: `"THIRTY_DAYS"`) + +* `SIXTY_DAYS` (value: `"SIXTY_DAYS"`) + +* `NINETY_DAYS` (value: `"NINETY_DAYS"`) + +* `MONTHLY` (value: `"MONTHLY"`) + +* `EVERY_TWO_MONTHS` (value: `"EVERY_TWO_MONTHS"`) + +* `QUARTERLY` (value: `"QUARTERLY"`) + +* `EVERY_FOUR_MONTHS` (value: `"EVERY_FOUR_MONTHS"`) + +* `EVERY_SIX_MONTHS` (value: `"EVERY_SIX_MONTHS"`) + +* `ANNUAL` (value: `"ANNUAL"`) + +* `EVERY_TWO_YEARS` (value: `"EVERY_TWO_YEARS"`) + + diff --git a/docs/SubscriptionEvent.md b/docs/SubscriptionEvent.md new file mode 100644 index 0000000..5e6bf43 --- /dev/null +++ b/docs/SubscriptionEvent.md @@ -0,0 +1,16 @@ +# SquareConnect.SubscriptionEvent + +### Description +**Note: This model is in beta.** + +Describes changes to subscription and billing states. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **String** | The ID of the subscription event. | +**subscription_event_type** | **String** | Type of the subscription event. See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values | +**effective_date** | **String** | The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect. | +**plan_id** | **String** | The ID of the subscription plan associated with the subscription. | + + diff --git a/docs/SubscriptionEventSubscriptionEventType.md b/docs/SubscriptionEventSubscriptionEventType.md new file mode 100644 index 0000000..afc9ff9 --- /dev/null +++ b/docs/SubscriptionEventSubscriptionEventType.md @@ -0,0 +1,12 @@ +# SquareConnect.SubscriptionEventSubscriptionEventType + +## Enum + + +* `START_SUBSCRIPTION` (value: `"START_SUBSCRIPTION"`) + +* `PLAN_CHANGE` (value: `"PLAN_CHANGE"`) + +* `STOP_SUBSCRIPTION` (value: `"STOP_SUBSCRIPTION"`) + + diff --git a/docs/SubscriptionPhase.md b/docs/SubscriptionPhase.md new file mode 100644 index 0000000..41ad59b --- /dev/null +++ b/docs/SubscriptionPhase.md @@ -0,0 +1,17 @@ +# SquareConnect.SubscriptionPhase + +### Description +**Note: This model is in beta.** + +Describes a phase in a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan). + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**uid** | **String** | The Square-assigned ID of the subscription phase. | [optional] +**cadence** | **String** | The billing cadence of the phase. For example, weekly or monthly. See [SubscriptionCadence](#type-subscriptioncadence) for possible values | +**periods** | **Number** | The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite. | [optional] +**recurring_price_money** | [**Money**](Money.md) | The amount to bill for each `cadence`. | +**ordinal** | **Number** | The position this phase appears in the sequence of phases defined for the plan, indexed from 0. | [optional] + + diff --git a/docs/SubscriptionStatus.md b/docs/SubscriptionStatus.md new file mode 100644 index 0000000..029f069 --- /dev/null +++ b/docs/SubscriptionStatus.md @@ -0,0 +1,14 @@ +# SquareConnect.SubscriptionStatus + +## Enum + + +* `DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE` (value: `"DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE"`) + +* `PENDING` (value: `"PENDING"`) + +* `ACTIVE` (value: `"ACTIVE"`) + +* `CANCELED` (value: `"CANCELED"`) + + diff --git a/docs/SubscriptionsApi.md b/docs/SubscriptionsApi.md new file mode 100644 index 0000000..f1bc564 --- /dev/null +++ b/docs/SubscriptionsApi.md @@ -0,0 +1,317 @@ +# SquareConnect.SubscriptionsApi + +All URIs are relative to *https://connect.squareup.com* + +Method | HTTP request | Description +------------- | ------------- | ------------- +[**cancelSubscription**](SubscriptionsApi.md#cancelSubscription) | **POST** /v2/subscriptions/{subscription_id}/cancel | CancelSubscription +[**createSubscription**](SubscriptionsApi.md#createSubscription) | **POST** /v2/subscriptions | CreateSubscription +[**listSubscriptionEvents**](SubscriptionsApi.md#listSubscriptionEvents) | **GET** /v2/subscriptions/{subscription_id}/events | ListSubscriptionEvents +[**retrieveSubscription**](SubscriptionsApi.md#retrieveSubscription) | **GET** /v2/subscriptions/{subscription_id} | RetrieveSubscription +[**searchSubscriptions**](SubscriptionsApi.md#searchSubscriptions) | **POST** /v2/subscriptions/search | SearchSubscriptions +[**updateSubscription**](SubscriptionsApi.md#updateSubscription) | **PUT** /v2/subscriptions/{subscription_id} | UpdateSubscription + + + +# **cancelSubscription** +**Note: This endpoint is in beta.** +> CancelSubscriptionResponse cancelSubscription(subscriptionId) + +CancelSubscription + +Cancels a subscription immediately and sets the subscription `status` to `CANCELED`. You can also use the `UpdateSubscription` endpoint to cancel a subscription at a future date. For more information, see [CancelSubscriptions](/docs/subscriptions-api/overview#cancel-subscriptions). + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var subscriptionId = "subscriptionId_example"; // String | The ID of the subscription to cancel. + +apiInstance.cancelSubscription(subscriptionId).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscriptionId** | **String**| The ID of the subscription to cancel. | + +### Return type + +[**CancelSubscriptionResponse**](CancelSubscriptionResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **createSubscription** +**Note: This endpoint is in beta.** +> CreateSubscriptionResponse createSubscription(body) + +CreateSubscription + +Creates a subscription for a customer to a subscription plan. If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square bills an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. For more information, see [Subscription API Overview](/docs/subscriptions-api/overview). + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var body = new SquareConnect.CreateSubscriptionRequest(); // CreateSubscriptionRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. + +apiInstance.createSubscription(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**CreateSubscriptionRequest**](CreateSubscriptionRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | + +### Return type + +[**CreateSubscriptionResponse**](CreateSubscriptionResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **listSubscriptionEvents** +**Note: This endpoint is in beta.** +> ListSubscriptionEventsResponse listSubscriptionEvents(subscriptionId, opts) + +ListSubscriptionEvents + +Lists all events for a specific subscription. In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned. + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var subscriptionId = "subscriptionId_example"; // String | The ID of the subscription to retrieve the events for. + +var opts = { + 'cursor': "cursor_example", // String | A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). + 'limit': 56 // Number | The upper limit on the number of subscription events to return in the response. Default: `200` +}; +apiInstance.listSubscriptionEvents(subscriptionId, opts).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscriptionId** | **String**| The ID of the subscription to retrieve the events for. | + **cursor** | **String**| A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). | [optional] + **limit** | **Number**| The upper limit on the number of subscription events to return in the response. Default: `200` | [optional] + +### Return type + +[**ListSubscriptionEventsResponse**](ListSubscriptionEventsResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **retrieveSubscription** +**Note: This endpoint is in beta.** +> RetrieveSubscriptionResponse retrieveSubscription(subscriptionId) + +RetrieveSubscription + +Retrieves a subscription. + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var subscriptionId = "subscriptionId_example"; // String | The ID of the subscription to retrieve. + +apiInstance.retrieveSubscription(subscriptionId).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscriptionId** | **String**| The ID of the subscription to retrieve. | + +### Return type + +[**RetrieveSubscriptionResponse**](RetrieveSubscriptionResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **searchSubscriptions** +**Note: This endpoint is in beta.** +> SearchSubscriptionsResponse searchSubscriptions(body) + +SearchSubscriptions + +Searches for subscriptions. Results are ordered chronologically by subscription creation date. If the request specifies more than one location ID, the endpoint orders the result by location ID, and then by creation date within each location. If no locations are given in the query, all locations are searched. You can also optionally specify `customer_ids` to search by customer. If left unset, all customers associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. For more information, see [Retrieve subscriptions](/docs/subscriptions-api/overview#retrieve-subscriptions). + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var body = new SquareConnect.SearchSubscriptionsRequest(); // SearchSubscriptionsRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. + +apiInstance.searchSubscriptions(body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**SearchSubscriptionsRequest**](SearchSubscriptionsRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | + +### Return type + +[**SearchSubscriptionsResponse**](SearchSubscriptionsResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + + +# **updateSubscription** +**Note: This endpoint is in beta.** +> UpdateSubscriptionResponse updateSubscription(subscriptionId, body) + +UpdateSubscription + +Updates a subscription. You can set, modify, and clear the `subscription` field values. For more information and examples, see [Update subscriptions](/docs/subscriptions-api/overview#update-subscriptions). + +### Example +```javascript +var SquareConnect = require('square-connect'); +var defaultClient = SquareConnect.ApiClient.instance; + +// Configure OAuth2 access token for authorization: oauth2 +var oauth2 = defaultClient.authentications['oauth2']; +oauth2.accessToken = 'YOUR ACCESS TOKEN'; + +var apiInstance = new SquareConnect.SubscriptionsApi(); + +var subscriptionId = "subscriptionId_example"; // String | The ID for the subscription to update. + +var body = new SquareConnect.UpdateSubscriptionRequest(); // UpdateSubscriptionRequest | An object containing the fields to POST for the request. See the corresponding object definition for field details. + +apiInstance.updateSubscription(subscriptionId, body).then(function(data) { + console.log('API called successfully. Returned data: ' + data); +}, function(error) { + console.error(error); +}); + +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **subscriptionId** | **String**| The ID for the subscription to update. | + **body** | [**UpdateSubscriptionRequest**](UpdateSubscriptionRequest.md)| An object containing the fields to POST for the request. See the corresponding object definition for field details. | + +### Return type + +[**UpdateSubscriptionResponse**](UpdateSubscriptionResponse.md) + +### Authorization + +[oauth2](../README.md#oauth2) + +### HTTP request headers + + - **Content-Type**: application/json + - **Accept**: application/json + diff --git a/docs/UpdateSubscriptionRequest.md b/docs/UpdateSubscriptionRequest.md new file mode 100644 index 0000000..58dc28b --- /dev/null +++ b/docs/UpdateSubscriptionRequest.md @@ -0,0 +1,13 @@ +# SquareConnect.UpdateSubscriptionRequest + +### Description +**Note: This model is in beta.** + +Defines parameters in a [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint request. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subscription** | [**Subscription**](Subscription.md) | The subscription object containing the current version, and fields to update. Unset fields will be left at their current server values, and JSON `null` values will be treated as a request to clear the relevant data. | [optional] + + diff --git a/docs/UpdateSubscriptionResponse.md b/docs/UpdateSubscriptionResponse.md new file mode 100644 index 0000000..d381d6b --- /dev/null +++ b/docs/UpdateSubscriptionResponse.md @@ -0,0 +1,14 @@ +# SquareConnect.UpdateSubscriptionResponse + +### Description +**Note: This model is in beta.** + +Defines the fields that are included in the response from the [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**errors** | [**[Error]**](Error.md) | Information about errors encountered during the request. | [optional] +**subscription** | [**Subscription**](Subscription.md) | The modified `Subscription` object. | [optional] + + diff --git a/package.json b/package.json index 43fd02c..d6406cc 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "square-connect", - "version": "4.20200722.1", + "version": "4.20200812.2", "description": "JavaScript client library for the Square Connect v2 API", "keywords": [ "square", diff --git a/src/ApiClient.js b/src/ApiClient.js index 3a6b9b5..21b36c9 100644 --- a/src/ApiClient.js +++ b/src/ApiClient.js @@ -17,7 +17,7 @@ var HeaderUtils = require('./lib/HeaderUtils'); /** * @module ApiClient - * @version 4.20200722.1 + * @version 4.20200812.2 */ /** @@ -49,7 +49,7 @@ var exports = function() { * @default {} */ this.defaultHeaders = { - 'User-Agent': 'Square-Connect-Javascript/4.20200722.1' + 'User-Agent': 'Square-Connect-Javascript/4.20200812.2' }; /** * The default HTTP timeout for all API calls. diff --git a/src/api/ApplePayApi.js b/src/api/ApplePayApi.js index ba8dca0..a6f9dea 100644 --- a/src/api/ApplePayApi.js +++ b/src/api/ApplePayApi.js @@ -21,7 +21,7 @@ var RegisterDomainResponse = require('../model/RegisterDomainResponse'); */ /** - * Constructs a new ApplePayApi. + * Constructs a new ApplePayApi. * @alias module:api/ApplePayApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -53,7 +53,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/BankAccountsApi.js b/src/api/BankAccountsApi.js index 4abdd6f..e333637 100644 --- a/src/api/BankAccountsApi.js +++ b/src/api/BankAccountsApi.js @@ -22,7 +22,7 @@ var ListBankAccountsResponse = require('../model/ListBankAccountsResponse'); */ /** - * Constructs a new BankAccountsApi. + * Constructs a new BankAccountsApi. * @alias module:api/BankAccountsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -55,7 +55,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -108,7 +108,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -162,7 +162,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CashDrawersApi.js b/src/api/CashDrawersApi.js index e2d3017..a861722 100644 --- a/src/api/CashDrawersApi.js +++ b/src/api/CashDrawersApi.js @@ -22,7 +22,7 @@ var RetrieveCashDrawerShiftResponse = require('../model/RetrieveCashDrawerShiftR */ /** - * Constructs a new CashDrawersApi. + * Constructs a new CashDrawersApi. * @alias module:api/CashDrawersApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -68,7 +68,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -137,7 +137,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -203,7 +203,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CatalogApi.js b/src/api/CatalogApi.js index e33f943..3a77b9b 100644 --- a/src/api/CatalogApi.js +++ b/src/api/CatalogApi.js @@ -39,7 +39,7 @@ var UpsertCatalogObjectResponse = require('../model/UpsertCatalogObjectResponse' */ /** - * Constructs a new CatalogApi. + * Constructs a new CatalogApi. * @alias module:api/CatalogApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -71,7 +71,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -123,7 +123,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -175,7 +175,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -221,7 +221,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -273,7 +273,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -325,7 +325,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -384,7 +384,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -439,7 +439,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -491,7 +491,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -543,7 +543,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -595,7 +595,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -647,7 +647,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CheckoutApi.js b/src/api/CheckoutApi.js index e215c98..7b8303a 100644 --- a/src/api/CheckoutApi.js +++ b/src/api/CheckoutApi.js @@ -21,7 +21,7 @@ var CreateCheckoutResponse = require('../model/CreateCheckoutResponse'); */ /** - * Constructs a new CheckoutApi. + * Constructs a new CheckoutApi. * @alias module:api/CheckoutApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -60,7 +60,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CustomerGroupsApi.js b/src/api/CustomerGroupsApi.js index 221dbc3..47d0db6 100644 --- a/src/api/CustomerGroupsApi.js +++ b/src/api/CustomerGroupsApi.js @@ -26,7 +26,7 @@ var UpdateCustomerGroupResponse = require('../model/UpdateCustomerGroupResponse' */ /** - * Constructs a new CustomerGroupsApi. + * Constructs a new CustomerGroupsApi. * @alias module:api/CustomerGroupsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -59,7 +59,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -113,7 +113,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -164,7 +164,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -219,7 +219,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -279,7 +279,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CustomerSegmentsApi.js b/src/api/CustomerSegmentsApi.js index 4ba3c0a..3d84351 100644 --- a/src/api/CustomerSegmentsApi.js +++ b/src/api/CustomerSegmentsApi.js @@ -21,7 +21,7 @@ var RetrieveCustomerSegmentResponse = require('../model/RetrieveCustomerSegmentR */ /** - * Constructs a new CustomerSegmentsApi. + * Constructs a new CustomerSegmentsApi. * @alias module:api/CustomerSegmentsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -52,7 +52,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -107,7 +107,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/CustomersApi.js b/src/api/CustomersApi.js index 7f57ec5..ea31944 100644 --- a/src/api/CustomersApi.js +++ b/src/api/CustomersApi.js @@ -33,7 +33,7 @@ var UpdateCustomerResponse = require('../model/UpdateCustomerResponse'); */ /** - * Constructs a new CustomersApi. + * Constructs a new CustomersApi. * @alias module:api/CustomersApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -74,7 +74,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -127,7 +127,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -186,7 +186,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -240,7 +240,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -300,7 +300,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -355,7 +355,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -419,7 +419,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -473,7 +473,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -525,7 +525,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -584,7 +584,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/DevicesApi.js b/src/api/DevicesApi.js index a04b427..09dcaaa 100644 --- a/src/api/DevicesApi.js +++ b/src/api/DevicesApi.js @@ -23,7 +23,7 @@ var ListDeviceCodesResponse = require('../model/ListDeviceCodesResponse'); */ /** - * Constructs a new DevicesApi. + * Constructs a new DevicesApi. * @alias module:api/DevicesApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -56,7 +56,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -110,7 +110,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -165,7 +165,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/DisputesApi.js b/src/api/DisputesApi.js index df50be2..c6c53dd 100644 --- a/src/api/DisputesApi.js +++ b/src/api/DisputesApi.js @@ -28,7 +28,7 @@ var SubmitEvidenceResponse = require('../model/SubmitEvidenceResponse'); */ /** - * Constructs a new DisputesApi. + * Constructs a new DisputesApi. * @alias module:api/DisputesApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -62,7 +62,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -122,7 +122,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -177,7 +177,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -232,7 +232,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -296,7 +296,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -351,7 +351,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -412,7 +412,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -467,7 +467,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/EmployeesApi.js b/src/api/EmployeesApi.js index 17addc6..e005ff3 100644 --- a/src/api/EmployeesApi.js +++ b/src/api/EmployeesApi.js @@ -21,7 +21,7 @@ var RetrieveEmployeeResponse = require('../model/RetrieveEmployeeResponse'); */ /** - * Constructs a new EmployeesApi. + * Constructs a new EmployeesApi. * @alias module:api/EmployeesApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -34,7 +34,7 @@ module.exports = function(apiClient) { /** * ListEmployees - * + * * @param {Object} opts Optional parameters * @param {String} opts.locationId Filter employees returned to only those that are associated with the specified location. * @param {String} opts.status Specifies the EmployeeStatus to filter the employee by. @@ -57,7 +57,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -76,7 +76,7 @@ module.exports = function(apiClient) { /** * ListEmployees - * + * * @param {Object} opts Optional parameters * @param {String} opts.locationId Filter employees returned to only those that are associated with the specified location. * @param {String} opts.status Specifies the EmployeeStatus to filter the employee by. @@ -94,7 +94,7 @@ module.exports = function(apiClient) { /** * RetrieveEmployee - * + * * @param {String} id UUID for the employee that was requested. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RetrieveEmployeeResponse} and HTTP response */ @@ -114,7 +114,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -133,7 +133,7 @@ module.exports = function(apiClient) { /** * RetrieveEmployee - * + * * @param {String} id UUID for the employee that was requested. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RetrieveEmployeeResponse} */ diff --git a/src/api/InventoryApi.js b/src/api/InventoryApi.js index 826aa68..6f02bf2 100644 --- a/src/api/InventoryApi.js +++ b/src/api/InventoryApi.js @@ -29,7 +29,7 @@ var RetrieveInventoryPhysicalCountResponse = require('../model/RetrieveInventory */ /** - * Constructs a new InventoryApi. + * Constructs a new InventoryApi. * @alias module:api/InventoryApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -61,7 +61,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -113,7 +113,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -165,7 +165,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -218,7 +218,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -277,7 +277,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -339,7 +339,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -395,7 +395,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/InvoicesApi.js b/src/api/InvoicesApi.js index a87b01e..b02dcea 100644 --- a/src/api/InvoicesApi.js +++ b/src/api/InvoicesApi.js @@ -32,7 +32,7 @@ var UpdateInvoiceResponse = require('../model/UpdateInvoiceResponse'); */ /** - * Constructs a new InvoicesApi. + * Constructs a new InvoicesApi. * @alias module:api/InvoicesApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -72,7 +72,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -126,7 +126,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -184,7 +184,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -240,7 +240,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -300,7 +300,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -363,7 +363,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -417,7 +417,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -477,7 +477,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/LaborApi.js b/src/api/LaborApi.js index f867e47..51c6558 100644 --- a/src/api/LaborApi.js +++ b/src/api/LaborApi.js @@ -39,7 +39,7 @@ var UpdateWorkweekConfigResponse = require('../model/UpdateWorkweekConfigRespons */ /** - * Constructs a new LaborApi. + * Constructs a new LaborApi. * @alias module:api/LaborApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -71,7 +71,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -123,7 +123,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -176,7 +176,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -229,7 +229,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -282,7 +282,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -335,7 +335,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -388,7 +388,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -442,7 +442,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -499,7 +499,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -554,7 +554,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -608,7 +608,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -667,7 +667,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -727,7 +727,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -787,7 +787,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/LocationsApi.js b/src/api/LocationsApi.js index 55b06cd..9f328d4 100644 --- a/src/api/LocationsApi.js +++ b/src/api/LocationsApi.js @@ -25,7 +25,7 @@ var UpdateLocationResponse = require('../model/UpdateLocationResponse'); */ /** - * Constructs a new LocationsApi. + * Constructs a new LocationsApi. * @alias module:api/LocationsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -58,7 +58,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -104,7 +104,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -156,7 +156,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -216,7 +216,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/LoyaltyApi.js b/src/api/LoyaltyApi.js index 8caf06b..9132436 100644 --- a/src/api/LoyaltyApi.js +++ b/src/api/LoyaltyApi.js @@ -41,7 +41,7 @@ var SearchLoyaltyRewardsResponse = require('../model/SearchLoyaltyRewardsRespons */ /** - * Constructs a new LoyaltyApi. + * Constructs a new LoyaltyApi. * @alias module:api/LoyaltyApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -81,7 +81,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -142,7 +142,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -203,7 +203,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -257,7 +257,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -310,7 +310,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -364,7 +364,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -411,7 +411,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -470,7 +470,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -525,7 +525,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -579,7 +579,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -632,7 +632,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -685,7 +685,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -738,7 +738,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/MerchantsApi.js b/src/api/MerchantsApi.js index 296c7f9..56d7488 100644 --- a/src/api/MerchantsApi.js +++ b/src/api/MerchantsApi.js @@ -21,7 +21,7 @@ var RetrieveMerchantResponse = require('../model/RetrieveMerchantResponse'); */ /** - * Constructs a new MerchantsApi. + * Constructs a new MerchantsApi. * @alias module:api/MerchantsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -51,7 +51,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -105,7 +105,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/MobileAuthorizationApi.js b/src/api/MobileAuthorizationApi.js index 1193baa..7ef5e9a 100644 --- a/src/api/MobileAuthorizationApi.js +++ b/src/api/MobileAuthorizationApi.js @@ -21,7 +21,7 @@ var CreateMobileAuthorizationCodeResponse = require('../model/CreateMobileAuthor */ /** - * Constructs a new MobileAuthorizationApi. + * Constructs a new MobileAuthorizationApi. * @alias module:api/MobileAuthorizationApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -53,7 +53,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/OAuthApi.js b/src/api/OAuthApi.js index 31eeeb0..f8be1b1 100644 --- a/src/api/OAuthApi.js +++ b/src/api/OAuthApi.js @@ -25,7 +25,7 @@ var RevokeTokenResponse = require('../model/RevokeTokenResponse'); */ /** - * Constructs a new OAuthApi. + * Constructs a new OAuthApi. * @alias module:api/OAuthApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -57,7 +57,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -118,7 +118,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -171,7 +171,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/OrdersApi.js b/src/api/OrdersApi.js index 881b4cb..95dea01 100644 --- a/src/api/OrdersApi.js +++ b/src/api/OrdersApi.js @@ -31,7 +31,7 @@ var UpdateOrderResponse = require('../model/UpdateOrderResponse'); */ /** - * Constructs a new OrdersApi. + * Constructs a new OrdersApi. * @alias module:api/OrdersApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -70,7 +70,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -124,7 +124,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -183,7 +183,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -244,7 +244,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -297,7 +297,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -364,7 +364,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/PaymentsApi.js b/src/api/PaymentsApi.js index 65870ef..da0ca44 100644 --- a/src/api/PaymentsApi.js +++ b/src/api/PaymentsApi.js @@ -15,7 +15,6 @@ var ApiClient = require('../ApiClient'); var CancelPaymentByIdempotencyKeyRequest = require('../model/CancelPaymentByIdempotencyKeyRequest'); var CancelPaymentByIdempotencyKeyResponse = require('../model/CancelPaymentByIdempotencyKeyResponse'); var CancelPaymentResponse = require('../model/CancelPaymentResponse'); -var CompletePaymentRequest = require('../model/CompletePaymentRequest'); var CompletePaymentResponse = require('../model/CompletePaymentResponse'); var CreatePaymentRequest = require('../model/CreatePaymentRequest'); var CreatePaymentResponse = require('../model/CreatePaymentResponse'); @@ -28,7 +27,7 @@ var ListPaymentsResponse = require('../model/ListPaymentsResponse'); */ /** - * Constructs a new PaymentsApi. + * Constructs a new PaymentsApi. * @alias module:api/PaymentsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -61,7 +60,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -113,7 +112,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -148,22 +147,16 @@ module.exports = function(apiClient) { * CompletePayment * Completes (captures) a payment. By default, payments are set to complete immediately after they are created. If you set autocomplete to false when creating a payment, you can complete (capture) the payment using this endpoint. For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments). * @param {String} paymentId Unique ID identifying the payment to be completed. - * @param {module:model/CompletePaymentRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CompletePaymentResponse} and HTTP response */ - this.completePaymentWithHttpInfo = function(paymentId, body) { - var postBody = body; + this.completePaymentWithHttpInfo = function(paymentId) { + var postBody = null; // verify the required parameter 'paymentId' is set if (paymentId === undefined || paymentId === null) { throw new Error("Missing the required parameter 'paymentId' when calling completePayment"); } - // verify the required parameter 'body' is set - if (body === undefined || body === null) { - throw new Error("Missing the required parameter 'body' when calling completePayment"); - } - var pathParams = { 'payment_id': paymentId @@ -172,7 +165,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -193,11 +186,10 @@ module.exports = function(apiClient) { * CompletePayment * Completes (captures) a payment. By default, payments are set to complete immediately after they are created. If you set autocomplete to false when creating a payment, you can complete (capture) the payment using this endpoint. For more information, see [Delayed Payments](/payments-api/take-payments#delayed-payments). * @param {String} paymentId Unique ID identifying the payment to be completed. - * @param {module:model/CompletePaymentRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CompletePaymentResponse} */ - this.completePayment = function(paymentId, body) { - return this.completePaymentWithHttpInfo(paymentId, body) + this.completePayment = function(paymentId) { + return this.completePaymentWithHttpInfo(paymentId) .then(function(response_and_data) { return response_and_data.data; }); @@ -225,7 +217,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -278,7 +270,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -342,7 +334,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/RefundsApi.js b/src/api/RefundsApi.js index 575a067..a7ae1d5 100644 --- a/src/api/RefundsApi.js +++ b/src/api/RefundsApi.js @@ -23,7 +23,7 @@ var RefundPaymentResponse = require('../model/RefundPaymentResponse'); */ /** - * Constructs a new RefundsApi. + * Constructs a new RefundsApi. * @alias module:api/RefundsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -56,7 +56,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -118,7 +118,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -177,7 +177,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/ReportingApi.js b/src/api/ReportingApi.js index 3721d34..3723180 100644 --- a/src/api/ReportingApi.js +++ b/src/api/ReportingApi.js @@ -21,7 +21,7 @@ var ListAdditionalRecipientReceivablesResponse = require('../model/ListAdditiona */ /** - * Constructs a new ReportingApi. + * Constructs a new ReportingApi. * @alias module:api/ReportingApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -66,7 +66,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -136,7 +136,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/SubscriptionsApi.js b/src/api/SubscriptionsApi.js new file mode 100644 index 0000000..6f48062 --- /dev/null +++ b/src/api/SubscriptionsApi.js @@ -0,0 +1,378 @@ +/** + * Square Connect API + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + */ +var ApiClient = require('../ApiClient'); +var CancelSubscriptionResponse = require('../model/CancelSubscriptionResponse'); +var CreateSubscriptionRequest = require('../model/CreateSubscriptionRequest'); +var CreateSubscriptionResponse = require('../model/CreateSubscriptionResponse'); +var ListSubscriptionEventsResponse = require('../model/ListSubscriptionEventsResponse'); +var RetrieveSubscriptionResponse = require('../model/RetrieveSubscriptionResponse'); +var SearchSubscriptionsRequest = require('../model/SearchSubscriptionsRequest'); +var SearchSubscriptionsResponse = require('../model/SearchSubscriptionsResponse'); +var UpdateSubscriptionRequest = require('../model/UpdateSubscriptionRequest'); +var UpdateSubscriptionResponse = require('../model/UpdateSubscriptionResponse'); + +/** + * Subscriptions service. + * @module api/SubscriptionsApi + */ + +/** + * Constructs a new SubscriptionsApi. + * @alias module:api/SubscriptionsApi + * @class + * @param {module:ApiClient} apiClient Optional API client implementation to use, + * default to {@link module:ApiClient#instance} if unspecified. + */ +module.exports = function(apiClient) { + this.apiClient = apiClient || ApiClient.instance; + + + + /** + * CancelSubscription + * Note: This endpoint is in beta. + * Cancels a subscription immediately and sets the subscription `status` to `CANCELED`. You can also use the `UpdateSubscription` endpoint to cancel a subscription at a future date. For more information, see [CancelSubscriptions](/docs/subscriptions-api/overview#cancel-subscriptions). + * @param {String} subscriptionId The ID of the subscription to cancel. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CancelSubscriptionResponse} and HTTP response + */ + this.cancelSubscriptionWithHttpInfo = function(subscriptionId) { + var postBody = null; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId === undefined || subscriptionId === null) { + throw new Error("Missing the required parameter 'subscriptionId' when calling cancelSubscription"); + } + + + var pathParams = { + 'subscription_id': subscriptionId + }; + var queryParams = { + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = CancelSubscriptionResponse; + + return this.apiClient.callApi( + '/v2/subscriptions/{subscription_id}/cancel', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * CancelSubscription + * Cancels a subscription immediately and sets the subscription `status` to `CANCELED`. You can also use the `UpdateSubscription` endpoint to cancel a subscription at a future date. For more information, see [CancelSubscriptions](/docs/subscriptions-api/overview#cancel-subscriptions). + * @param {String} subscriptionId The ID of the subscription to cancel. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CancelSubscriptionResponse} + */ + this.cancelSubscription = function(subscriptionId) { + return this.cancelSubscriptionWithHttpInfo(subscriptionId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * CreateSubscription + * Note: This endpoint is in beta. + * Creates a subscription for a customer to a subscription plan. If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square bills an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. For more information, see [Subscription API Overview](/docs/subscriptions-api/overview). + * @param {module:model/CreateSubscriptionRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CreateSubscriptionResponse} and HTTP response + */ + this.createSubscriptionWithHttpInfo = function(body) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling createSubscription"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = CreateSubscriptionResponse; + + return this.apiClient.callApi( + '/v2/subscriptions', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * CreateSubscription + * Creates a subscription for a customer to a subscription plan. If you provide a card on file in the request, Square charges the card for the subscription. Otherwise, Square bills an invoice to the customer's email address. The subscription starts immediately, unless the request includes the optional `start_date`. Each individual subscription is associated with a particular location. For more information, see [Subscription API Overview](/docs/subscriptions-api/overview). + * @param {module:model/CreateSubscriptionRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CreateSubscriptionResponse} + */ + this.createSubscription = function(body) { + return this.createSubscriptionWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * ListSubscriptionEvents + * Note: This endpoint is in beta. + * Lists all events for a specific subscription. In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned. + * @param {String} subscriptionId The ID of the subscription to retrieve the events for. + * @param {Object} opts Optional parameters + * @param {String} opts.cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). + * @param {Number} opts.limit The upper limit on the number of subscription events to return in the response. Default: `200` + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/ListSubscriptionEventsResponse} and HTTP response + */ + this.listSubscriptionEventsWithHttpInfo = function(subscriptionId, opts) { + opts = opts || {}; + var postBody = null; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId === undefined || subscriptionId === null) { + throw new Error("Missing the required parameter 'subscriptionId' when calling listSubscriptionEvents"); + } + + + var pathParams = { + 'subscription_id': subscriptionId + }; + var queryParams = { + 'cursor': opts['cursor'], + 'limit': opts['limit'] + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = ListSubscriptionEventsResponse; + + return this.apiClient.callApi( + '/v2/subscriptions/{subscription_id}/events', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * ListSubscriptionEvents + * Lists all events for a specific subscription. In the current implementation, only `START_SUBSCRIPTION` and `STOP_SUBSCRIPTION` (when the subscription was canceled) events are returned. + * @param {String} subscriptionId The ID of the subscription to retrieve the events for. + * @param {Object} opts Optional parameters + * @param {String} opts.cursor A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination). + * @param {Number} opts.limit The upper limit on the number of subscription events to return in the response. Default: `200` + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/ListSubscriptionEventsResponse} + */ + this.listSubscriptionEvents = function(subscriptionId, opts) { + return this.listSubscriptionEventsWithHttpInfo(subscriptionId, opts) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * RetrieveSubscription + * Note: This endpoint is in beta. + * Retrieves a subscription. + * @param {String} subscriptionId The ID of the subscription to retrieve. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/RetrieveSubscriptionResponse} and HTTP response + */ + this.retrieveSubscriptionWithHttpInfo = function(subscriptionId) { + var postBody = null; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId === undefined || subscriptionId === null) { + throw new Error("Missing the required parameter 'subscriptionId' when calling retrieveSubscription"); + } + + + var pathParams = { + 'subscription_id': subscriptionId + }; + var queryParams = { + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = RetrieveSubscriptionResponse; + + return this.apiClient.callApi( + '/v2/subscriptions/{subscription_id}', 'GET', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * RetrieveSubscription + * Retrieves a subscription. + * @param {String} subscriptionId The ID of the subscription to retrieve. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/RetrieveSubscriptionResponse} + */ + this.retrieveSubscription = function(subscriptionId) { + return this.retrieveSubscriptionWithHttpInfo(subscriptionId) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * SearchSubscriptions + * Note: This endpoint is in beta. + * Searches for subscriptions. Results are ordered chronologically by subscription creation date. If the request specifies more than one location ID, the endpoint orders the result by location ID, and then by creation date within each location. If no locations are given in the query, all locations are searched. You can also optionally specify `customer_ids` to search by customer. If left unset, all customers associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. For more information, see [Retrieve subscriptions](/docs/subscriptions-api/overview#retrieve-subscriptions). + * @param {module:model/SearchSubscriptionsRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/SearchSubscriptionsResponse} and HTTP response + */ + this.searchSubscriptionsWithHttpInfo = function(body) { + var postBody = body; + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling searchSubscriptions"); + } + + + var pathParams = { + }; + var queryParams = { + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = SearchSubscriptionsResponse; + + return this.apiClient.callApi( + '/v2/subscriptions/search', 'POST', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * SearchSubscriptions + * Searches for subscriptions. Results are ordered chronologically by subscription creation date. If the request specifies more than one location ID, the endpoint orders the result by location ID, and then by creation date within each location. If no locations are given in the query, all locations are searched. You can also optionally specify `customer_ids` to search by customer. If left unset, all customers associated with the specified locations are returned. If the request specifies customer IDs, the endpoint orders results first by location, within location by customer ID, and within customer by subscription creation date. For more information, see [Retrieve subscriptions](/docs/subscriptions-api/overview#retrieve-subscriptions). + * @param {module:model/SearchSubscriptionsRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/SearchSubscriptionsResponse} + */ + this.searchSubscriptions = function(body) { + return this.searchSubscriptionsWithHttpInfo(body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } + + + /** + * UpdateSubscription + * Note: This endpoint is in beta. + * Updates a subscription. You can set, modify, and clear the `subscription` field values. For more information and examples, see [Update subscriptions](/docs/subscriptions-api/overview#update-subscriptions). + * @param {String} subscriptionId The ID for the subscription to update. + * @param {module:model/UpdateSubscriptionRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/UpdateSubscriptionResponse} and HTTP response + */ + this.updateSubscriptionWithHttpInfo = function(subscriptionId, body) { + var postBody = body; + + // verify the required parameter 'subscriptionId' is set + if (subscriptionId === undefined || subscriptionId === null) { + throw new Error("Missing the required parameter 'subscriptionId' when calling updateSubscription"); + } + + // verify the required parameter 'body' is set + if (body === undefined || body === null) { + throw new Error("Missing the required parameter 'body' when calling updateSubscription"); + } + + + var pathParams = { + 'subscription_id': subscriptionId + }; + var queryParams = { + }; + var headerParams = { + }; + headerParams['Square-Version'] = '2020-08-12'; + + var formParams = { + }; + + var authNames = ['oauth2']; + var contentTypes = ['application/json']; + var accepts = ['application/json']; + var returnType = UpdateSubscriptionResponse; + + return this.apiClient.callApi( + '/v2/subscriptions/{subscription_id}', 'PUT', + pathParams, queryParams, headerParams, formParams, postBody, + authNames, contentTypes, accepts, returnType + ); + } + + /** + * UpdateSubscription + * Updates a subscription. You can set, modify, and clear the `subscription` field values. For more information and examples, see [Update subscriptions](/docs/subscriptions-api/overview#update-subscriptions). + * @param {String} subscriptionId The ID for the subscription to update. + * @param {module:model/UpdateSubscriptionRequest} body An object containing the fields to POST for the request. See the corresponding object definition for field details. + * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/UpdateSubscriptionResponse} + */ + this.updateSubscription = function(subscriptionId, body) { + return this.updateSubscriptionWithHttpInfo(subscriptionId, body) + .then(function(response_and_data) { + return response_and_data.data; + }); + } +}; diff --git a/src/api/TeamApi.js b/src/api/TeamApi.js index c75c031..9746937 100644 --- a/src/api/TeamApi.js +++ b/src/api/TeamApi.js @@ -33,7 +33,7 @@ var UpdateWageSettingResponse = require('../model/UpdateWageSettingResponse'); */ /** - * Constructs a new TeamApi. + * Constructs a new TeamApi. * @alias module:api/TeamApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -65,7 +65,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -117,7 +117,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -169,7 +169,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -222,7 +222,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -275,7 +275,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -327,7 +327,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -386,7 +386,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -446,7 +446,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/TerminalApi.js b/src/api/TerminalApi.js index fe625c8..c38d6c2 100644 --- a/src/api/TerminalApi.js +++ b/src/api/TerminalApi.js @@ -25,7 +25,7 @@ var SearchTerminalCheckoutsResponse = require('../model/SearchTerminalCheckoutsR */ /** - * Constructs a new TerminalApi. + * Constructs a new TerminalApi. * @alias module:api/TerminalApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -59,7 +59,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -112,7 +112,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -166,7 +166,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -219,7 +219,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/TransactionsApi.js b/src/api/TransactionsApi.js index 54cbfb7..fb92574 100644 --- a/src/api/TransactionsApi.js +++ b/src/api/TransactionsApi.js @@ -28,7 +28,7 @@ var VoidTransactionResponse = require('../model/VoidTransactionResponse'); */ /** - * Constructs a new TransactionsApi. + * Constructs a new TransactionsApi. * @alias module:api/TransactionsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -43,8 +43,8 @@ module.exports = function(apiClient) { * @deprecated * CaptureTransaction * Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information. - * @param {String} locationId - * @param {String} transactionId + * @param {String} locationId + * @param {String} transactionId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/CaptureTransactionResponse} and HTTP response */ this.captureTransactionWithHttpInfo = function(locationId, transactionId) { @@ -70,7 +70,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -90,8 +90,8 @@ module.exports = function(apiClient) { /** * CaptureTransaction * Captures a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information. - * @param {String} locationId - * @param {String} transactionId + * @param {String} locationId + * @param {String} transactionId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/CaptureTransactionResponse} */ this.captureTransaction = function(locationId, transactionId) { @@ -132,7 +132,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -201,7 +201,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -268,7 +268,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -338,7 +338,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -405,7 +405,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -441,8 +441,8 @@ module.exports = function(apiClient) { * @deprecated * VoidTransaction * Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information. - * @param {String} locationId - * @param {String} transactionId + * @param {String} locationId + * @param {String} transactionId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/VoidTransactionResponse} and HTTP response */ this.voidTransactionWithHttpInfo = function(locationId, transactionId) { @@ -468,7 +468,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -488,8 +488,8 @@ module.exports = function(apiClient) { /** * VoidTransaction * Cancels a transaction that was created with the [Charge](#endpoint-charge) endpoint with a `delay_capture` value of `true`. See [Delayed capture transactions](/payments/transactions/overview#delayed-capture) for more information. - * @param {String} locationId - * @param {String} transactionId + * @param {String} locationId + * @param {String} transactionId * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/VoidTransactionResponse} */ this.voidTransaction = function(locationId, transactionId) { diff --git a/src/api/V1EmployeesApi.js b/src/api/V1EmployeesApi.js index fe31e7a..bde35a5 100644 --- a/src/api/V1EmployeesApi.js +++ b/src/api/V1EmployeesApi.js @@ -24,7 +24,7 @@ var V1TimecardEvent = require('../model/V1TimecardEvent'); */ /** - * Constructs a new V1EmployeesApi. + * Constructs a new V1EmployeesApi. * @alias module:api/V1EmployeesApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -56,7 +56,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -108,7 +108,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -162,7 +162,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -217,7 +217,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -280,7 +280,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -338,7 +338,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -407,7 +407,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -471,7 +471,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -543,7 +543,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -616,7 +616,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -670,7 +670,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -723,7 +723,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -778,7 +778,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -811,7 +811,7 @@ module.exports = function(apiClient) { /** * UpdateEmployee - * + * * @param {String} employeeId The ID of the role to modify. * @param {module:model/V1Employee} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link module:model/V1Employee} and HTTP response @@ -837,7 +837,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -856,7 +856,7 @@ module.exports = function(apiClient) { /** * UpdateEmployee - * + * * @param {String} employeeId The ID of the role to modify. * @param {module:model/V1Employee} body An object containing the fields to POST for the request. See the corresponding object definition for field details. * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with data of type {@link module:model/V1Employee} @@ -897,7 +897,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -959,7 +959,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/V1ItemsApi.js b/src/api/V1ItemsApi.js index 7b87703..93c7788 100644 --- a/src/api/V1ItemsApi.js +++ b/src/api/V1ItemsApi.js @@ -31,7 +31,7 @@ var V1Variation = require('../model/V1Variation'); */ /** - * Constructs a new V1ItemsApi. + * Constructs a new V1ItemsApi. * @alias module:api/V1ItemsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -79,7 +79,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -150,7 +150,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -221,7 +221,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -284,7 +284,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -346,7 +346,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -408,7 +408,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -470,7 +470,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -532,7 +532,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -601,7 +601,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -664,7 +664,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -733,7 +733,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -797,7 +797,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -860,7 +860,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -923,7 +923,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -986,7 +986,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1049,7 +1049,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1119,7 +1119,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1183,7 +1183,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1252,7 +1252,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1325,7 +1325,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1382,7 +1382,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1437,7 +1437,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1492,7 +1492,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1553,7 +1553,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1615,7 +1615,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1672,7 +1672,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1727,7 +1727,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1796,7 +1796,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1867,7 +1867,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1931,7 +1931,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -1994,7 +1994,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2063,7 +2063,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2133,7 +2133,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2203,7 +2203,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2273,7 +2273,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2343,7 +2343,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2420,7 +2420,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2491,7 +2491,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2561,7 +2561,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -2638,7 +2638,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/V1LocationsApi.js b/src/api/V1LocationsApi.js index 485ef78..cad84a9 100644 --- a/src/api/V1LocationsApi.js +++ b/src/api/V1LocationsApi.js @@ -20,7 +20,7 @@ var V1Merchant = require('../model/V1Merchant'); */ /** - * Constructs a new V1LocationsApi. + * Constructs a new V1LocationsApi. * @alias module:api/V1LocationsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -48,7 +48,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -95,7 +95,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/api/V1TransactionsApi.js b/src/api/V1TransactionsApi.js index 1cb3ad6..bb9004d 100644 --- a/src/api/V1TransactionsApi.js +++ b/src/api/V1TransactionsApi.js @@ -26,7 +26,7 @@ var V1UpdateOrderRequest = require('../model/V1UpdateOrderRequest'); */ /** - * Constructs a new V1TransactionsApi. + * Constructs a new V1TransactionsApi. * @alias module:api/V1TransactionsApi * @class * @param {module:ApiClient} apiClient Optional API client implementation to use, @@ -65,7 +65,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -121,7 +121,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -182,7 +182,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -253,7 +253,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -325,7 +325,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -398,7 +398,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -467,7 +467,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -528,7 +528,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -589,7 +589,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -650,7 +650,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; @@ -717,7 +717,7 @@ module.exports = function(apiClient) { }; var headerParams = { }; - headerParams['Square-Version'] = '2020-07-22'; + headerParams['Square-Version'] = '2020-08-12'; var formParams = { }; diff --git a/src/index.js b/src/index.js index c7abb83..274ce39 100644 --- a/src/index.js +++ b/src/index.js @@ -61,6 +61,8 @@ var CancelPaymentByIdempotencyKeyRequest = require('./model/CancelPaymentByIdemp var CancelPaymentByIdempotencyKeyResponse = require('./model/CancelPaymentByIdempotencyKeyResponse'); var CancelPaymentRequest = require('./model/CancelPaymentRequest'); var CancelPaymentResponse = require('./model/CancelPaymentResponse'); +var CancelSubscriptionRequest = require('./model/CancelSubscriptionRequest'); +var CancelSubscriptionResponse = require('./model/CancelSubscriptionResponse'); var CancelTerminalCheckoutRequest = require('./model/CancelTerminalCheckoutRequest'); var CancelTerminalCheckoutResponse = require('./model/CancelTerminalCheckoutResponse'); var CaptureTransactionRequest = require('./model/CaptureTransactionRequest'); @@ -127,6 +129,7 @@ var CatalogQuickAmount = require('./model/CatalogQuickAmount'); var CatalogQuickAmountType = require('./model/CatalogQuickAmountType'); var CatalogQuickAmountsSettings = require('./model/CatalogQuickAmountsSettings'); var CatalogQuickAmountsSettingsOption = require('./model/CatalogQuickAmountsSettingsOption'); +var CatalogSubscriptionPlan = require('./model/CatalogSubscriptionPlan'); var CatalogTax = require('./model/CatalogTax'); var CatalogTimePeriod = require('./model/CatalogTimePeriod'); var CatalogV1Id = require('./model/CatalogV1Id'); @@ -174,6 +177,8 @@ var CreateRefundRequest = require('./model/CreateRefundRequest'); var CreateRefundResponse = require('./model/CreateRefundResponse'); var CreateShiftRequest = require('./model/CreateShiftRequest'); var CreateShiftResponse = require('./model/CreateShiftResponse'); +var CreateSubscriptionRequest = require('./model/CreateSubscriptionRequest'); +var CreateSubscriptionResponse = require('./model/CreateSubscriptionResponse'); var CreateTeamMemberRequest = require('./model/CreateTeamMemberRequest'); var CreateTeamMemberResponse = require('./model/CreateTeamMemberResponse'); var CreateTerminalCheckoutRequest = require('./model/CreateTerminalCheckoutRequest'); @@ -319,6 +324,8 @@ var ListPaymentsRequest = require('./model/ListPaymentsRequest'); var ListPaymentsResponse = require('./model/ListPaymentsResponse'); var ListRefundsRequest = require('./model/ListRefundsRequest'); var ListRefundsResponse = require('./model/ListRefundsResponse'); +var ListSubscriptionEventsRequest = require('./model/ListSubscriptionEventsRequest'); +var ListSubscriptionEventsResponse = require('./model/ListSubscriptionEventsResponse'); var ListTransactionsRequest = require('./model/ListTransactionsRequest'); var ListTransactionsResponse = require('./model/ListTransactionsResponse'); var ListWorkweekConfigsRequest = require('./model/ListWorkweekConfigsRequest'); @@ -475,6 +482,8 @@ var RetrieveLoyaltyRewardRequest = require('./model/RetrieveLoyaltyRewardRequest var RetrieveLoyaltyRewardResponse = require('./model/RetrieveLoyaltyRewardResponse'); var RetrieveMerchantRequest = require('./model/RetrieveMerchantRequest'); var RetrieveMerchantResponse = require('./model/RetrieveMerchantResponse'); +var RetrieveSubscriptionRequest = require('./model/RetrieveSubscriptionRequest'); +var RetrieveSubscriptionResponse = require('./model/RetrieveSubscriptionResponse'); var RetrieveTeamMemberRequest = require('./model/RetrieveTeamMemberRequest'); var RetrieveTeamMemberResponse = require('./model/RetrieveTeamMemberResponse'); var RetrieveTransactionRequest = require('./model/RetrieveTransactionRequest'); @@ -513,6 +522,10 @@ var SearchOrdersSourceFilter = require('./model/SearchOrdersSourceFilter'); var SearchOrdersStateFilter = require('./model/SearchOrdersStateFilter'); var SearchShiftsRequest = require('./model/SearchShiftsRequest'); var SearchShiftsResponse = require('./model/SearchShiftsResponse'); +var SearchSubscriptionsFilter = require('./model/SearchSubscriptionsFilter'); +var SearchSubscriptionsQuery = require('./model/SearchSubscriptionsQuery'); +var SearchSubscriptionsRequest = require('./model/SearchSubscriptionsRequest'); +var SearchSubscriptionsResponse = require('./model/SearchSubscriptionsResponse'); var SearchTeamMembersFilter = require('./model/SearchTeamMembersFilter'); var SearchTeamMembersQuery = require('./model/SearchTeamMembersQuery'); var SearchTeamMembersRequest = require('./model/SearchTeamMembersRequest'); @@ -535,6 +548,12 @@ var StandardUnitDescription = require('./model/StandardUnitDescription'); var StandardUnitDescriptionGroup = require('./model/StandardUnitDescriptionGroup'); var SubmitEvidenceRequest = require('./model/SubmitEvidenceRequest'); var SubmitEvidenceResponse = require('./model/SubmitEvidenceResponse'); +var Subscription = require('./model/Subscription'); +var SubscriptionCadence = require('./model/SubscriptionCadence'); +var SubscriptionEvent = require('./model/SubscriptionEvent'); +var SubscriptionEventSubscriptionEventType = require('./model/SubscriptionEventSubscriptionEventType'); +var SubscriptionPhase = require('./model/SubscriptionPhase'); +var SubscriptionStatus = require('./model/SubscriptionStatus'); var TaxCalculationPhase = require('./model/TaxCalculationPhase'); var TaxInclusionType = require('./model/TaxInclusionType'); var TeamMember = require('./model/TeamMember'); @@ -574,6 +593,8 @@ var UpdateOrderRequest = require('./model/UpdateOrderRequest'); var UpdateOrderResponse = require('./model/UpdateOrderResponse'); var UpdateShiftRequest = require('./model/UpdateShiftRequest'); var UpdateShiftResponse = require('./model/UpdateShiftResponse'); +var UpdateSubscriptionRequest = require('./model/UpdateSubscriptionRequest'); +var UpdateSubscriptionResponse = require('./model/UpdateSubscriptionResponse'); var UpdateTeamMemberRequest = require('./model/UpdateTeamMemberRequest'); var UpdateTeamMemberResponse = require('./model/UpdateTeamMemberResponse'); var UpdateWageSettingRequest = require('./model/UpdateWageSettingRequest'); @@ -771,6 +792,7 @@ var OrdersApi = require('./api/OrdersApi'); var PaymentsApi = require('./api/PaymentsApi'); var RefundsApi = require('./api/RefundsApi'); var ReportingApi = require('./api/ReportingApi'); +var SubscriptionsApi = require('./api/SubscriptionsApi'); var TeamApi = require('./api/TeamApi'); var TerminalApi = require('./api/TerminalApi'); var TransactionsApi = require('./api/TransactionsApi'); @@ -809,7 +831,7 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * *
* @module index - * @version 4.20200722.1 + * @version 4.20200812.2 */ module.exports = { /** @@ -1057,6 +1079,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/CancelPaymentResponse} */ CancelPaymentResponse: CancelPaymentResponse, + /** + * The CancelSubscriptionRequest model constructor. + * @property {module:model/CancelSubscriptionRequest} + */ + CancelSubscriptionRequest: CancelSubscriptionRequest, + /** + * The CancelSubscriptionResponse model constructor. + * @property {module:model/CancelSubscriptionResponse} + */ + CancelSubscriptionResponse: CancelSubscriptionResponse, /** * The CancelTerminalCheckoutRequest model constructor. * @property {module:model/CancelTerminalCheckoutRequest} @@ -1387,6 +1419,11 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/CatalogQuickAmountsSettingsOption} */ CatalogQuickAmountsSettingsOption: CatalogQuickAmountsSettingsOption, + /** + * The CatalogSubscriptionPlan model constructor. + * @property {module:model/CatalogSubscriptionPlan} + */ + CatalogSubscriptionPlan: CatalogSubscriptionPlan, /** * The CatalogTax model constructor. * @property {module:model/CatalogTax} @@ -1622,6 +1659,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/CreateShiftResponse} */ CreateShiftResponse: CreateShiftResponse, + /** + * The CreateSubscriptionRequest model constructor. + * @property {module:model/CreateSubscriptionRequest} + */ + CreateSubscriptionRequest: CreateSubscriptionRequest, + /** + * The CreateSubscriptionResponse model constructor. + * @property {module:model/CreateSubscriptionResponse} + */ + CreateSubscriptionResponse: CreateSubscriptionResponse, /** * The CreateTeamMemberRequest model constructor. * @property {module:model/CreateTeamMemberRequest} @@ -2347,6 +2394,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/ListRefundsResponse} */ ListRefundsResponse: ListRefundsResponse, + /** + * The ListSubscriptionEventsRequest model constructor. + * @property {module:model/ListSubscriptionEventsRequest} + */ + ListSubscriptionEventsRequest: ListSubscriptionEventsRequest, + /** + * The ListSubscriptionEventsResponse model constructor. + * @property {module:model/ListSubscriptionEventsResponse} + */ + ListSubscriptionEventsResponse: ListSubscriptionEventsResponse, /** * The ListTransactionsRequest model constructor. * @property {module:model/ListTransactionsRequest} @@ -3127,6 +3184,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/RetrieveMerchantResponse} */ RetrieveMerchantResponse: RetrieveMerchantResponse, + /** + * The RetrieveSubscriptionRequest model constructor. + * @property {module:model/RetrieveSubscriptionRequest} + */ + RetrieveSubscriptionRequest: RetrieveSubscriptionRequest, + /** + * The RetrieveSubscriptionResponse model constructor. + * @property {module:model/RetrieveSubscriptionResponse} + */ + RetrieveSubscriptionResponse: RetrieveSubscriptionResponse, /** * The RetrieveTeamMemberRequest model constructor. * @property {module:model/RetrieveTeamMemberRequest} @@ -3317,6 +3384,26 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/SearchShiftsResponse} */ SearchShiftsResponse: SearchShiftsResponse, + /** + * The SearchSubscriptionsFilter model constructor. + * @property {module:model/SearchSubscriptionsFilter} + */ + SearchSubscriptionsFilter: SearchSubscriptionsFilter, + /** + * The SearchSubscriptionsQuery model constructor. + * @property {module:model/SearchSubscriptionsQuery} + */ + SearchSubscriptionsQuery: SearchSubscriptionsQuery, + /** + * The SearchSubscriptionsRequest model constructor. + * @property {module:model/SearchSubscriptionsRequest} + */ + SearchSubscriptionsRequest: SearchSubscriptionsRequest, + /** + * The SearchSubscriptionsResponse model constructor. + * @property {module:model/SearchSubscriptionsResponse} + */ + SearchSubscriptionsResponse: SearchSubscriptionsResponse, /** * The SearchTeamMembersFilter model constructor. * @property {module:model/SearchTeamMembersFilter} @@ -3427,6 +3514,36 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/SubmitEvidenceResponse} */ SubmitEvidenceResponse: SubmitEvidenceResponse, + /** + * The Subscription model constructor. + * @property {module:model/Subscription} + */ + Subscription: Subscription, + /** + * The SubscriptionCadence model constructor. + * @property {module:model/SubscriptionCadence} + */ + SubscriptionCadence: SubscriptionCadence, + /** + * The SubscriptionEvent model constructor. + * @property {module:model/SubscriptionEvent} + */ + SubscriptionEvent: SubscriptionEvent, + /** + * The SubscriptionEventSubscriptionEventType model constructor. + * @property {module:model/SubscriptionEventSubscriptionEventType} + */ + SubscriptionEventSubscriptionEventType: SubscriptionEventSubscriptionEventType, + /** + * The SubscriptionPhase model constructor. + * @property {module:model/SubscriptionPhase} + */ + SubscriptionPhase: SubscriptionPhase, + /** + * The SubscriptionStatus model constructor. + * @property {module:model/SubscriptionStatus} + */ + SubscriptionStatus: SubscriptionStatus, /** * The TaxCalculationPhase model constructor. * @property {module:model/TaxCalculationPhase} @@ -3622,6 +3739,16 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:model/UpdateShiftResponse} */ UpdateShiftResponse: UpdateShiftResponse, + /** + * The UpdateSubscriptionRequest model constructor. + * @property {module:model/UpdateSubscriptionRequest} + */ + UpdateSubscriptionRequest: UpdateSubscriptionRequest, + /** + * The UpdateSubscriptionResponse model constructor. + * @property {module:model/UpdateSubscriptionResponse} + */ + UpdateSubscriptionResponse: UpdateSubscriptionResponse, /** * The UpdateTeamMemberRequest model constructor. * @property {module:model/UpdateTeamMemberRequest} @@ -4602,6 +4729,11 @@ var V1TransactionsApi = require('./api/V1TransactionsApi'); * @property {module:api/ReportingApi} */ ReportingApi: ReportingApi, + /** + * The SubscriptionsApi service constructor. + * @property {module:api/SubscriptionsApi} + */ + SubscriptionsApi: SubscriptionsApi, /** * The TeamApi service constructor. * @property {module:api/TeamApi} diff --git a/src/model/CancelSubscriptionRequest.js b/src/model/CancelSubscriptionRequest.js new file mode 100644 index 0000000..edb3059 --- /dev/null +++ b/src/model/CancelSubscriptionRequest.js @@ -0,0 +1,57 @@ +/** + * Square Connect API + * Client library for accessing the Square Connect APIs + * + * OpenAPI spec version: 2.0 + * Contact: developers@squareup.com + * + * NOTE: This class is auto generated by the swagger code generator program. + * https://github.com/swagger-api/swagger-codegen.git + * + * Swagger Codegen version: 2.3.0-SNAPSHOT + * + */ +var ApiClient = require('../ApiClient'); + + + + +/** + * The CancelSubscriptionRequest model module. + * Note: This model is in beta. + * @module model/CancelSubscriptionRequest + */ + +/** + * Constructs a newCancelSubscriptionRequest
.
+ * Defines parameters in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) endpoint request.
+ * @alias module:model/CancelSubscriptionRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+};
+
+/**
+ * Constructs a CancelSubscriptionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CancelSubscriptionRequest} obj Optional instance to populate.
+ * @return {module:model/CancelSubscriptionRequest} The populated CancelSubscriptionRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ }
+ return obj;
+}
+
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/CancelSubscriptionResponse.js b/src/model/CancelSubscriptionResponse.js
new file mode 100644
index 0000000..ff0fcb8
--- /dev/null
+++ b/src/model/CancelSubscriptionResponse.js
@@ -0,0 +1,77 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The CancelSubscriptionResponse model module.
+ * Note: This model is in beta.
+ * @module model/CancelSubscriptionResponse
+ */
+
+/**
+ * Constructs a new CancelSubscriptionResponse
.
+ * Defines fields that are included in a [CancelSubscription](#endpoint-subscriptions-cancelsubscription) response.
+ * @alias module:model/CancelSubscriptionResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CancelSubscriptionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CancelSubscriptionResponse} obj Optional instance to populate.
+ * @return {module:model/CancelSubscriptionResponse} The populated CancelSubscriptionResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscription')) {
+ obj['subscription'] = Subscription.constructFromObject(data['subscription']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.CatalogObject
.
- * The wrapper object for the Catalog entries of a given object type. The type of a particular `CatalogObject` is determined by the value of the `type` attribute and only the corresponding data attribute can be set on the `CatalogObject` instance. For example, the following list shows some instances of `CatalogObject` of a given `type` and their corresponding data atrribute that can be set: - For a `CatalogObject` of the `ITEM` type, set the `item_data` attribute to yield the `CatalogItem` object. - For a `CatalogObject` of the `ITEM_VARIATION` type, set the `item_variation_data` attribute to yield the `CatalogItemVariation` object. - For a `CatalogObject` of the `MODIFIER` type, set the `modifier_data` attribute to yield the `CatalogModifier` object. - For a `CatalogObject` of the `MODIFIER_LIST` type, set the `modifier_list_data` attribute to yield the `CatalogModifierList` object. - For a `CatalogObject` of the `CATEGORY` type, set the `category_data` attribute to yield the `CatalogCategory` object. - For a `CatalogObject` of the `DISCOUNT` type, set the `discount_data` attribute to yield the `CatalogDiscount` object. - For a `CatalogObject` of the `TAX` type, set the `tax_data` attribute to yield the `CatalogTax` object. - For a `CatalogObject` of the `IMAGE` type, set the `image_data` attribute to yield the `CatalogImageData` object. - For a `CatalogObject` of the `QUICK_AMOUNTS_SETTINGS` type, set the `quick_amounts_settings_data` attribute to yield the `CatalogQuickAmountsSettings` object. - For a `CatalogObject` of the `PRICING_RULE` type, set the `pricing_rule_data` attribute to yield the `CatalogPricingRule` object. - For a `CatalogObject` of the `TIME_PERIOD` type, set the `time_period_data` attribute to yield the `CatalogTimePeriod` object. - For a `CatalogObject` of the `PRODUCT_SET` type, set the `product_set_data` attribute to yield the `CatalogProductSet` object. For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide.
+ * The wrapper object for the Catalog entries of a given object type. The type of a particular `CatalogObject` is determined by the value of the `type` attribute and only the corresponding data attribute can be set on the `CatalogObject` instance. For example, the following list shows some instances of `CatalogObject` of a given `type` and their corresponding data atrribute that can be set: - For a `CatalogObject` of the `ITEM` type, set the `item_data` attribute to yield the `CatalogItem` object. - For a `CatalogObject` of the `ITEM_VARIATION` type, set the `item_variation_data` attribute to yield the `CatalogItemVariation` object. - For a `CatalogObject` of the `MODIFIER` type, set the `modifier_data` attribute to yield the `CatalogModifier` object. - For a `CatalogObject` of the `MODIFIER_LIST` type, set the `modifier_list_data` attribute to yield the `CatalogModifierList` object. - For a `CatalogObject` of the `CATEGORY` type, set the `category_data` attribute to yield the `CatalogCategory` object. - For a `CatalogObject` of the `DISCOUNT` type, set the `discount_data` attribute to yield the `CatalogDiscount` object. - For a `CatalogObject` of the `TAX` type, set the `tax_data` attribute to yield the `CatalogTax` object. - For a `CatalogObject` of the `IMAGE` type, set the `image_data` attribute to yield the `CatalogImageData` object. - For a `CatalogObject` of the `QUICK_AMOUNTS_SETTINGS` type, set the `quick_amounts_settings_data` attribute to yield the `CatalogQuickAmountsSettings` object. - For a `CatalogObject` of the `PRICING_RULE` type, set the `pricing_rule_data` attribute to yield the `CatalogPricingRule` object. - For a `CatalogObject` of the `TIME_PERIOD` type, set the `time_period_data` attribute to yield the `CatalogTimePeriod` object. - For a `CatalogObject` of the `PRODUCT_SET` type, set the `product_set_data` attribute to yield the `CatalogProductSet` object. - For a `CatalogObject` of the `SUBSCRIPTION_PLAN` type, set the `subscription_plan_data` attribute to yield the `CatalogSubscriptionPlan` object. For a more detailed discussion of the Catalog data model, please see the [Design a Catalog](/catalog-api/design-a-catalog) guide.
* @alias module:model/CatalogObject
* @class
* @param type {String} The type of this object. Each object type has expected properties expressed in a structured format within its corresponding `*_data` field below. See [CatalogObjectType](#type-catalogobjecttype) for possible values
@@ -75,6 +76,7 @@ var exports = function(type, id) {
+
};
@@ -158,6 +160,9 @@ exports.constructFromObject = function(data, obj) {
}
if (data.hasOwnProperty('measurement_unit_data')) {
obj['measurement_unit_data'] = CatalogMeasurementUnit.constructFromObject(data['measurement_unit_data']);
+ }
+ if (data.hasOwnProperty('subscription_plan_data')) {
+ obj['subscription_plan_data'] = CatalogSubscriptionPlan.constructFromObject(data['subscription_plan_data']);
}
if (data.hasOwnProperty('item_option_data')) {
obj['item_option_data'] = CatalogItemOption.constructFromObject(data['item_option_data']);
@@ -290,6 +295,11 @@ exports.prototype['image_data'] = undefined;
* @member {module:model/CatalogMeasurementUnit} measurement_unit_data
*/
exports.prototype['measurement_unit_data'] = undefined;
+/**
+ * Structured data for a `CatalogSubscriptionPlan`, set for CatalogObjects of type `SUBSCRIPTION_PLAN`.
+ * @member {module:model/CatalogSubscriptionPlan} subscription_plan_data
+ */
+exports.prototype['subscription_plan_data'] = undefined;
/**
* Structured data for a `CatalogItemOption`, set for CatalogObjects of type `ITEM_OPTION`.
* @member {module:model/CatalogItemOption} item_option_data
diff --git a/src/model/CatalogObjectType.js b/src/model/CatalogObjectType.js
index d3ced09..3b3faa7 100644
--- a/src/model/CatalogObjectType.js
+++ b/src/model/CatalogObjectType.js
@@ -80,6 +80,11 @@ var exports = {
* @const
*/
"MEASUREMENT_UNIT": "MEASUREMENT_UNIT",
+ /**
+ * value: "SUBSCRIPTION_PLAN"
+ * @const
+ */
+ "SUBSCRIPTION_PLAN": "SUBSCRIPTION_PLAN",
/**
* value: "ITEM_OPTION"
* @const
diff --git a/src/model/CatalogSubscriptionPlan.js b/src/model/CatalogSubscriptionPlan.js
new file mode 100644
index 0000000..1680b3a
--- /dev/null
+++ b/src/model/CatalogSubscriptionPlan.js
@@ -0,0 +1,76 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var SubscriptionPhase = require('./SubscriptionPhase');
+
+
+
+
+/**
+ * The CatalogSubscriptionPlan model module.
+ * Note: This model is in beta.
+ * @module model/CatalogSubscriptionPlan
+ */
+
+/**
+ * Constructs a new CatalogSubscriptionPlan
.
+ * Describes a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan).
+ * @alias module:model/CatalogSubscriptionPlan
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CatalogSubscriptionPlan
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CatalogSubscriptionPlan} obj Optional instance to populate.
+ * @return {module:model/CatalogSubscriptionPlan} The populated CatalogSubscriptionPlan
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('name')) {
+ obj['name'] = ApiClient.convertToType(data['name'], 'String');
+ }
+ if (data.hasOwnProperty('phases')) {
+ obj['phases'] = ApiClient.convertToType(data['phases'], [SubscriptionPhase]);
+ }
+ }
+ return obj;
+}
+
+/**
+ * The name of the plan.
+ * @member {String} name
+ */
+exports.prototype['name'] = undefined;
+/**
+ * A list of SubscriptionPhase containing the `SubscriptionPhase` for this plan.
+ * @member {Array.CreateSubscriptionRequest
.
+ * Defines parameters in a [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint request.
+ * @alias module:model/CreateSubscriptionRequest
+ * @class
+ * @param idempotencyKey {String} A unique string that identifies this `CreateSubscription` request. If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see [Idempotency keys](https://developer.squareup.com/docs/docs/working-with-apis/idempotency).
+ * @param locationId {String} The ID of the location the subscription is associated with.
+ * @param planId {String} The ID of the subscription plan. For more information, see [Subscription Plan Overview](https://developer.squareup.com/docs/docs/subscriptions/overview).
+ * @param customerId {String} The ID of the `customer` profile.
+ */
+var exports = function(idempotencyKey, locationId, planId, customerId) {
+ var _this = this;
+
+ _this['idempotency_key'] = idempotencyKey;
+ _this['location_id'] = locationId;
+ _this['plan_id'] = planId;
+ _this['customer_id'] = customerId;
+
+
+
+
+
+
+};
+
+/**
+ * Constructs a CreateSubscriptionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CreateSubscriptionRequest} obj Optional instance to populate.
+ * @return {module:model/CreateSubscriptionRequest} The populated CreateSubscriptionRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('idempotency_key')) {
+ obj['idempotency_key'] = ApiClient.convertToType(data['idempotency_key'], 'String');
+ }
+ if (data.hasOwnProperty('location_id')) {
+ obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
+ }
+ if (data.hasOwnProperty('plan_id')) {
+ obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String');
+ }
+ if (data.hasOwnProperty('customer_id')) {
+ obj['customer_id'] = ApiClient.convertToType(data['customer_id'], 'String');
+ }
+ if (data.hasOwnProperty('start_date')) {
+ obj['start_date'] = ApiClient.convertToType(data['start_date'], 'String');
+ }
+ if (data.hasOwnProperty('canceled_date')) {
+ obj['canceled_date'] = ApiClient.convertToType(data['canceled_date'], 'String');
+ }
+ if (data.hasOwnProperty('tax_percentage')) {
+ obj['tax_percentage'] = ApiClient.convertToType(data['tax_percentage'], 'String');
+ }
+ if (data.hasOwnProperty('price_override_money')) {
+ obj['price_override_money'] = Money.constructFromObject(data['price_override_money']);
+ }
+ if (data.hasOwnProperty('card_id')) {
+ obj['card_id'] = ApiClient.convertToType(data['card_id'], 'String');
+ }
+ if (data.hasOwnProperty('timezone')) {
+ obj['timezone'] = ApiClient.convertToType(data['timezone'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * A unique string that identifies this `CreateSubscription` request. If you do not provide a unique string (or provide an empty string as the value), the endpoint treats each request as independent. For more information, see [Idempotency keys](https://developer.squareup.com/docs/docs/working-with-apis/idempotency).
+ * @member {String} idempotency_key
+ */
+exports.prototype['idempotency_key'] = undefined;
+/**
+ * The ID of the location the subscription is associated with.
+ * @member {String} location_id
+ */
+exports.prototype['location_id'] = undefined;
+/**
+ * The ID of the subscription plan. For more information, see [Subscription Plan Overview](https://developer.squareup.com/docs/docs/subscriptions/overview).
+ * @member {String} plan_id
+ */
+exports.prototype['plan_id'] = undefined;
+/**
+ * The ID of the `customer` profile.
+ * @member {String} customer_id
+ */
+exports.prototype['customer_id'] = undefined;
+/**
+ * The start date of the subscription, in YYYY-MM-DD format. For example, 2013-01-15. If the start date is left empty, the subscription begins immediately.
+ * @member {String} start_date
+ */
+exports.prototype['start_date'] = undefined;
+/**
+ * The date when the subscription should be canceled, in YYYY-MM-DD format (for example, 2025-02-29). This overrides the plan configuration if it comes before the date the subscription would otherwise end.
+ * @member {String} canceled_date
+ */
+exports.prototype['canceled_date'] = undefined;
+/**
+ * The tax to add when billing the subscription. The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. For example, a value of 7.5 corresponds to 7.5%.
+ * @member {String} tax_percentage
+ */
+exports.prototype['tax_percentage'] = undefined;
+/**
+ * A custom price to apply for the subscription. If specified, it overrides the price configured by the subscription plan.
+ * @member {module:model/Money} price_override_money
+ */
+exports.prototype['price_override_money'] = undefined;
+/**
+ * The ID of the `customer](#type-customer) [card` to charge. If not specified, Square sends an invoice via email. For an example to create a customer and add a card on file, see [Subscriptions Walkthrough](https://developer.squareup.com/docs/docs/subscriptions-api/walkthrough).
+ * @member {String} card_id
+ */
+exports.prototype['card_id'] = undefined;
+/**
+ * The timezone that is used in date calculations for the subscription. If unset, defaults to the location timezone. If a timezone is not configured for the location, defaults to \"America/New_York\". Format: the IANA Timezone Database identifier for the location timezone. For a list of time zones, see [List of tz database time zones](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones).
+ * @member {String} timezone
+ */
+exports.prototype['timezone'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/CreateSubscriptionResponse.js b/src/model/CreateSubscriptionResponse.js
new file mode 100644
index 0000000..410c30e
--- /dev/null
+++ b/src/model/CreateSubscriptionResponse.js
@@ -0,0 +1,77 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The CreateSubscriptionResponse model module.
+ * Note: This model is in beta.
+ * @module model/CreateSubscriptionResponse
+ */
+
+/**
+ * Constructs a new CreateSubscriptionResponse
.
+ * Defines the fields that are included in the response from the [CreateSubscription](#endpoint-subscriptions-createsubscription) endpoint.
+ * @alias module:model/CreateSubscriptionResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a CreateSubscriptionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/CreateSubscriptionResponse} obj Optional instance to populate.
+ * @return {module:model/CreateSubscriptionResponse} The populated CreateSubscriptionResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscription')) {
+ obj['subscription'] = Subscription.constructFromObject(data['subscription']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.ListSubscriptionEventsRequest
.
+ * Defines parameters in a [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint request.
+ * @alias module:model/ListSubscriptionEventsRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a ListSubscriptionEventsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/ListSubscriptionEventsRequest} obj Optional instance to populate.
+ * @return {module:model/ListSubscriptionEventsRequest} The populated ListSubscriptionEventsRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ if (data.hasOwnProperty('limit')) {
+ obj['limit'] = ApiClient.convertToType(data['limit'], 'Number');
+ }
+ }
+ return obj;
+}
+
+/**
+ * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination).
+ * @member {String} cursor
+ */
+exports.prototype['cursor'] = undefined;
+/**
+ * The upper limit on the number of subscription events to return in the response. Default: `200`
+ * @member {Number} limit
+ */
+exports.prototype['limit'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/ListSubscriptionEventsResponse.js b/src/model/ListSubscriptionEventsResponse.js
new file mode 100644
index 0000000..ab60c6e
--- /dev/null
+++ b/src/model/ListSubscriptionEventsResponse.js
@@ -0,0 +1,86 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var SubscriptionEvent = require('./SubscriptionEvent');
+
+
+
+
+/**
+ * The ListSubscriptionEventsResponse model module.
+ * Note: This model is in beta.
+ * @module model/ListSubscriptionEventsResponse
+ */
+
+/**
+ * Constructs a new ListSubscriptionEventsResponse
.
+ * Defines the fields that are included in the response from the [ListSubscriptionEvents](#endpoint-subscriptions-listsubscriptionevents) endpoint.
+ * @alias module:model/ListSubscriptionEventsResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a ListSubscriptionEventsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/ListSubscriptionEventsResponse} obj Optional instance to populate.
+ * @return {module:model/ListSubscriptionEventsResponse} The populated ListSubscriptionEventsResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscription_events')) {
+ obj['subscription_events'] = ApiClient.convertToType(data['subscription_events'], [SubscriptionEvent]);
+ }
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.RetrieveSubscriptionRequest
.
+ * Defines parameters in a [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint request.
+ * @alias module:model/RetrieveSubscriptionRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+};
+
+/**
+ * Constructs a RetrieveSubscriptionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/RetrieveSubscriptionRequest} obj Optional instance to populate.
+ * @return {module:model/RetrieveSubscriptionRequest} The populated RetrieveSubscriptionRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ }
+ return obj;
+}
+
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/RetrieveSubscriptionResponse.js b/src/model/RetrieveSubscriptionResponse.js
new file mode 100644
index 0000000..d9f001c
--- /dev/null
+++ b/src/model/RetrieveSubscriptionResponse.js
@@ -0,0 +1,77 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The RetrieveSubscriptionResponse model module.
+ * Note: This model is in beta.
+ * @module model/RetrieveSubscriptionResponse
+ */
+
+/**
+ * Constructs a new RetrieveSubscriptionResponse
.
+ * Defines the fields that are included in the response from the [RetrieveSubscription](#endpoint-subscriptions-retrievesubscription) endpoint.
+ * @alias module:model/RetrieveSubscriptionResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a RetrieveSubscriptionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/RetrieveSubscriptionResponse} obj Optional instance to populate.
+ * @return {module:model/RetrieveSubscriptionResponse} The populated RetrieveSubscriptionResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscription')) {
+ obj['subscription'] = Subscription.constructFromObject(data['subscription']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.SearchSubscriptionsFilter
.
+ * Represents a set of SearchSubscriptionsQuery filters used to limit the set of Subscriptions returned by SearchSubscriptions.
+ * @alias module:model/SearchSubscriptionsFilter
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a SearchSubscriptionsFilter
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchSubscriptionsFilter} obj Optional instance to populate.
+ * @return {module:model/SearchSubscriptionsFilter} The populated SearchSubscriptionsFilter
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('customer_ids')) {
+ obj['customer_ids'] = ApiClient.convertToType(data['customer_ids'], ['String']);
+ }
+ if (data.hasOwnProperty('location_ids')) {
+ obj['location_ids'] = ApiClient.convertToType(data['location_ids'], ['String']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * A filter to select subscriptions based on the customer.
+ * @member {Array.SearchSubscriptionsQuery
.
+ * Represents a query (including filtering criteria) used to search for subscriptions.
+ * @alias module:model/SearchSubscriptionsQuery
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+};
+
+/**
+ * Constructs a SearchSubscriptionsQuery
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchSubscriptionsQuery} obj Optional instance to populate.
+ * @return {module:model/SearchSubscriptionsQuery} The populated SearchSubscriptionsQuery
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('filter')) {
+ obj['filter'] = SearchSubscriptionsFilter.constructFromObject(data['filter']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * A list of filtering criteria.
+ * @member {module:model/SearchSubscriptionsFilter} filter
+ */
+exports.prototype['filter'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/SearchSubscriptionsRequest.js b/src/model/SearchSubscriptionsRequest.js
new file mode 100644
index 0000000..9bd00fa
--- /dev/null
+++ b/src/model/SearchSubscriptionsRequest.js
@@ -0,0 +1,85 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var SearchSubscriptionsQuery = require('./SearchSubscriptionsQuery');
+
+
+
+
+/**
+ * The SearchSubscriptionsRequest model module.
+ * Note: This model is in beta.
+ * @module model/SearchSubscriptionsRequest
+ */
+
+/**
+ * Constructs a new SearchSubscriptionsRequest
.
+ * Defines parameters in a [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint request.
+ * @alias module:model/SearchSubscriptionsRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a SearchSubscriptionsRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchSubscriptionsRequest} obj Optional instance to populate.
+ * @return {module:model/SearchSubscriptionsRequest} The populated SearchSubscriptionsRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ if (data.hasOwnProperty('limit')) {
+ obj['limit'] = ApiClient.convertToType(data['limit'], 'Number');
+ }
+ if (data.hasOwnProperty('query')) {
+ obj['query'] = SearchSubscriptionsQuery.constructFromObject(data['query']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * A pagination cursor returned by a previous call to this endpoint. Provide this to retrieve the next set of results for the original query. For more information, see [Pagination](https://developer.squareup.com/docs/docs/working-with-apis/pagination).
+ * @member {String} cursor
+ */
+exports.prototype['cursor'] = undefined;
+/**
+ * The upper limit on the number of subscriptions to return in the response. Default: `200`
+ * @member {Number} limit
+ */
+exports.prototype['limit'] = undefined;
+/**
+ * Query subscriptions based on the given conditions and sort order. Calling SearchSubscriptions without an explicit query parameter will return all subscriptions.
+ * @member {module:model/SearchSubscriptionsQuery} query
+ */
+exports.prototype['query'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/SearchSubscriptionsResponse.js b/src/model/SearchSubscriptionsResponse.js
new file mode 100644
index 0000000..5a5ef2f
--- /dev/null
+++ b/src/model/SearchSubscriptionsResponse.js
@@ -0,0 +1,86 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The SearchSubscriptionsResponse model module.
+ * Note: This model is in beta.
+ * @module model/SearchSubscriptionsResponse
+ */
+
+/**
+ * Constructs a new SearchSubscriptionsResponse
.
+ * Defines the fields that are included in the response from the [SearchSubscriptions](#endpoint-subscriptions-searchsubscriptions) endpoint.
+ * @alias module:model/SearchSubscriptionsResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+};
+
+/**
+ * Constructs a SearchSubscriptionsResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SearchSubscriptionsResponse} obj Optional instance to populate.
+ * @return {module:model/SearchSubscriptionsResponse} The populated SearchSubscriptionsResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscriptions')) {
+ obj['subscriptions'] = ApiClient.convertToType(data['subscriptions'], [Subscription]);
+ }
+ if (data.hasOwnProperty('cursor')) {
+ obj['cursor'] = ApiClient.convertToType(data['cursor'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.Subscription
.
+ * Represents a customer subscription to a subscription plan. For an overview of the `Subscription` type, see [Subscription object](/docs/subscriptions-api/overview#subscription-object-overview).
+ * @alias module:model/Subscription
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+};
+
+/**
+ * Constructs a Subscription
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/Subscription} obj Optional instance to populate.
+ * @return {module:model/Subscription} The populated Subscription
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'String');
+ }
+ if (data.hasOwnProperty('location_id')) {
+ obj['location_id'] = ApiClient.convertToType(data['location_id'], 'String');
+ }
+ if (data.hasOwnProperty('plan_id')) {
+ obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String');
+ }
+ if (data.hasOwnProperty('customer_id')) {
+ obj['customer_id'] = ApiClient.convertToType(data['customer_id'], 'String');
+ }
+ if (data.hasOwnProperty('start_date')) {
+ obj['start_date'] = ApiClient.convertToType(data['start_date'], 'String');
+ }
+ if (data.hasOwnProperty('canceled_date')) {
+ obj['canceled_date'] = ApiClient.convertToType(data['canceled_date'], 'String');
+ }
+ if (data.hasOwnProperty('status')) {
+ obj['status'] = ApiClient.convertToType(data['status'], 'String');
+ }
+ if (data.hasOwnProperty('tax_percentage')) {
+ obj['tax_percentage'] = ApiClient.convertToType(data['tax_percentage'], 'String');
+ }
+ if (data.hasOwnProperty('invoice_ids')) {
+ obj['invoice_ids'] = ApiClient.convertToType(data['invoice_ids'], ['String']);
+ }
+ if (data.hasOwnProperty('price_override_money')) {
+ obj['price_override_money'] = Money.constructFromObject(data['price_override_money']);
+ }
+ if (data.hasOwnProperty('version')) {
+ obj['version'] = ApiClient.convertToType(data['version'], 'Number');
+ }
+ if (data.hasOwnProperty('created_at')) {
+ obj['created_at'] = ApiClient.convertToType(data['created_at'], 'String');
+ }
+ if (data.hasOwnProperty('card_id')) {
+ obj['card_id'] = ApiClient.convertToType(data['card_id'], 'String');
+ }
+ if (data.hasOwnProperty('paid_until_date')) {
+ obj['paid_until_date'] = ApiClient.convertToType(data['paid_until_date'], 'String');
+ }
+ if (data.hasOwnProperty('timezone')) {
+ obj['timezone'] = ApiClient.convertToType(data['timezone'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * The Square-assigned ID of the subscription.
+ * @member {String} id
+ */
+exports.prototype['id'] = undefined;
+/**
+ * The ID of the location associated with the subscription.
+ * @member {String} location_id
+ */
+exports.prototype['location_id'] = undefined;
+/**
+ * The ID of the associated `subscription plan`.
+ * @member {String} plan_id
+ */
+exports.prototype['plan_id'] = undefined;
+/**
+ * The ID of the associated `customer` profile.
+ * @member {String} customer_id
+ */
+exports.prototype['customer_id'] = undefined;
+/**
+ * The start date of the subscription, in YYYY-MM-DD format (for example, 2013-01-15).
+ * @member {String} start_date
+ */
+exports.prototype['start_date'] = undefined;
+/**
+ * The subscription cancellation date, in YYYY-MM-DD format (for example, 2013-01-15). On this date, the subscription status changes to `CANCELED` and the subscription billing stops. If you don't set this field, the subscription plan dictates if and when subscription ends. You cannot update this field, you can only clear it.
+ * @member {String} canceled_date
+ */
+exports.prototype['canceled_date'] = undefined;
+/**
+ * The current status of the subscription. See [SubscriptionStatus](#type-subscriptionstatus) for possible values
+ * @member {String} status
+ */
+exports.prototype['status'] = undefined;
+/**
+ * The tax amount applied when billing the subscription. The percentage is expressed in decimal form, using a `'.'` as the decimal separator and without a `'%'` sign. For example, a value of `7.5` corresponds to 7.5%.
+ * @member {String} tax_percentage
+ */
+exports.prototype['tax_percentage'] = undefined;
+/**
+ * The IDs of the `invoices` created for the subscription, listed in order when the invoices were created (oldest invoices appear first).
+ * @member {Array.SubscriptionCadence
enum value from a Javascript object name.
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
+ * @return {module:model/SubscriptionCadence} The enum SubscriptionCadence
value.
+ */
+exports.constructFromObject = function(object) {
+ return object;
+}
+
+module.exports = exports;
+
+
diff --git a/src/model/SubscriptionEvent.js b/src/model/SubscriptionEvent.js
new file mode 100644
index 0000000..f185a66
--- /dev/null
+++ b/src/model/SubscriptionEvent.js
@@ -0,0 +1,97 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+
+
+/**
+ * The SubscriptionEvent model module.
+ * Note: This model is in beta.
+ * @module model/SubscriptionEvent
+ */
+
+/**
+ * Constructs a new SubscriptionEvent
.
+ * Describes changes to subscription and billing states.
+ * @alias module:model/SubscriptionEvent
+ * @class
+ * @param id {String} The ID of the subscription event.
+ * @param subscriptionEventType {String} Type of the subscription event. See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values
+ * @param effectiveDate {String} The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect.
+ * @param planId {String} The ID of the subscription plan associated with the subscription.
+ */
+var exports = function(id, subscriptionEventType, effectiveDate, planId) {
+ var _this = this;
+
+ _this['id'] = id;
+ _this['subscription_event_type'] = subscriptionEventType;
+ _this['effective_date'] = effectiveDate;
+ _this['plan_id'] = planId;
+};
+
+/**
+ * Constructs a SubscriptionEvent
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SubscriptionEvent} obj Optional instance to populate.
+ * @return {module:model/SubscriptionEvent} The populated SubscriptionEvent
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('id')) {
+ obj['id'] = ApiClient.convertToType(data['id'], 'String');
+ }
+ if (data.hasOwnProperty('subscription_event_type')) {
+ obj['subscription_event_type'] = ApiClient.convertToType(data['subscription_event_type'], 'String');
+ }
+ if (data.hasOwnProperty('effective_date')) {
+ obj['effective_date'] = ApiClient.convertToType(data['effective_date'], 'String');
+ }
+ if (data.hasOwnProperty('plan_id')) {
+ obj['plan_id'] = ApiClient.convertToType(data['plan_id'], 'String');
+ }
+ }
+ return obj;
+}
+
+/**
+ * The ID of the subscription event.
+ * @member {String} id
+ */
+exports.prototype['id'] = undefined;
+/**
+ * Type of the subscription event. See [SubscriptionEventSubscriptionEventType](#type-subscriptioneventsubscriptioneventtype) for possible values
+ * @member {String} subscription_event_type
+ */
+exports.prototype['subscription_event_type'] = undefined;
+/**
+ * The date, in YYYY-MM-DD format (for example, 2013-01-15), when the subscription event went into effect.
+ * @member {String} effective_date
+ */
+exports.prototype['effective_date'] = undefined;
+/**
+ * The ID of the subscription plan associated with the subscription.
+ * @member {String} plan_id
+ */
+exports.prototype['plan_id'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/SubscriptionEventSubscriptionEventType.js b/src/model/SubscriptionEventSubscriptionEventType.js
new file mode 100644
index 0000000..8c7b41e
--- /dev/null
+++ b/src/model/SubscriptionEventSubscriptionEventType.js
@@ -0,0 +1,50 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+/**
+ * Enum class SubscriptionEventSubscriptionEventType.
+ * @enum {}
+ * @readonly
+ */
+var exports = {
+ /**
+ * value: "START_SUBSCRIPTION"
+ * @const
+ */
+ "START_SUBSCRIPTION": "START_SUBSCRIPTION",
+ /**
+ * value: "PLAN_CHANGE"
+ * @const
+ */
+ "PLAN_CHANGE": "PLAN_CHANGE",
+ /**
+ * value: "STOP_SUBSCRIPTION"
+ * @const
+ */
+ "STOP_SUBSCRIPTION": "STOP_SUBSCRIPTION"};
+
+/**
+ * Returns a SubscriptionEventSubscriptionEventType
enum value from a Javascript object name.
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
+ * @return {module:model/SubscriptionEventSubscriptionEventType} The enum SubscriptionEventSubscriptionEventType
value.
+ */
+exports.constructFromObject = function(object) {
+ return object;
+}
+
+module.exports = exports;
+
+
diff --git a/src/model/SubscriptionPhase.js b/src/model/SubscriptionPhase.js
new file mode 100644
index 0000000..9378307
--- /dev/null
+++ b/src/model/SubscriptionPhase.js
@@ -0,0 +1,105 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Money = require('./Money');
+
+
+
+
+/**
+ * The SubscriptionPhase model module.
+ * Note: This model is in beta.
+ * @module model/SubscriptionPhase
+ */
+
+/**
+ * Constructs a new SubscriptionPhase
.
+ * Describes a phase in a subscription plan. For more information, see [Set Up and Manage a Subscription Plan](/docs/subscriptions-api/setup-plan).
+ * @alias module:model/SubscriptionPhase
+ * @class
+ * @param cadence {String} The billing cadence of the phase. For example, weekly or monthly. See [SubscriptionCadence](#type-subscriptioncadence) for possible values
+ * @param recurringPriceMoney {module:model/Money} The amount to bill for each `cadence`.
+ */
+var exports = function(cadence, recurringPriceMoney) {
+ var _this = this;
+
+
+ _this['cadence'] = cadence;
+
+ _this['recurring_price_money'] = recurringPriceMoney;
+
+};
+
+/**
+ * Constructs a SubscriptionPhase
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/SubscriptionPhase} obj Optional instance to populate.
+ * @return {module:model/SubscriptionPhase} The populated SubscriptionPhase
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('uid')) {
+ obj['uid'] = ApiClient.convertToType(data['uid'], 'String');
+ }
+ if (data.hasOwnProperty('cadence')) {
+ obj['cadence'] = ApiClient.convertToType(data['cadence'], 'String');
+ }
+ if (data.hasOwnProperty('periods')) {
+ obj['periods'] = ApiClient.convertToType(data['periods'], 'Number');
+ }
+ if (data.hasOwnProperty('recurring_price_money')) {
+ obj['recurring_price_money'] = Money.constructFromObject(data['recurring_price_money']);
+ }
+ if (data.hasOwnProperty('ordinal')) {
+ obj['ordinal'] = ApiClient.convertToType(data['ordinal'], 'Number');
+ }
+ }
+ return obj;
+}
+
+/**
+ * The Square-assigned ID of the subscription phase.
+ * @member {String} uid
+ */
+exports.prototype['uid'] = undefined;
+/**
+ * The billing cadence of the phase. For example, weekly or monthly. See [SubscriptionCadence](#type-subscriptioncadence) for possible values
+ * @member {String} cadence
+ */
+exports.prototype['cadence'] = undefined;
+/**
+ * The number of `cadence`s the phase lasts. If not set, the phase never ends. Only the last phase can be indefinite.
+ * @member {Number} periods
+ */
+exports.prototype['periods'] = undefined;
+/**
+ * The amount to bill for each `cadence`.
+ * @member {module:model/Money} recurring_price_money
+ */
+exports.prototype['recurring_price_money'] = undefined;
+/**
+ * The position this phase appears in the sequence of phases defined for the plan, indexed from 0.
+ * @member {Number} ordinal
+ */
+exports.prototype['ordinal'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/SubscriptionStatus.js b/src/model/SubscriptionStatus.js
new file mode 100644
index 0000000..befaca4
--- /dev/null
+++ b/src/model/SubscriptionStatus.js
@@ -0,0 +1,55 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+
+
+/**
+ * Enum class SubscriptionStatus.
+ * @enum {}
+ * @readonly
+ */
+var exports = {
+ /**
+ * value: "DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE"
+ * @const
+ */
+ "DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE": "DEFAULT_SUBSCRIPTION_STATUS_DO_NOT_USE",
+ /**
+ * value: "PENDING"
+ * @const
+ */
+ "PENDING": "PENDING",
+ /**
+ * value: "ACTIVE"
+ * @const
+ */
+ "ACTIVE": "ACTIVE",
+ /**
+ * value: "CANCELED"
+ * @const
+ */
+ "CANCELED": "CANCELED"};
+
+/**
+ * Returns a SubscriptionStatus
enum value from a Javascript object name.
+ * @param {Object} data The plain JavaScript object containing the name of the enum value.
+ * @return {module:model/SubscriptionStatus} The enum SubscriptionStatus
value.
+ */
+exports.constructFromObject = function(object) {
+ return object;
+}
+
+module.exports = exports;
+
+
diff --git a/src/model/UpdateSubscriptionRequest.js b/src/model/UpdateSubscriptionRequest.js
new file mode 100644
index 0000000..15bc62f
--- /dev/null
+++ b/src/model/UpdateSubscriptionRequest.js
@@ -0,0 +1,67 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The UpdateSubscriptionRequest model module.
+ * Note: This model is in beta.
+ * @module model/UpdateSubscriptionRequest
+ */
+
+/**
+ * Constructs a new UpdateSubscriptionRequest
.
+ * Defines parameters in a [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint request.
+ * @alias module:model/UpdateSubscriptionRequest
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+};
+
+/**
+ * Constructs a UpdateSubscriptionRequest
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/UpdateSubscriptionRequest} obj Optional instance to populate.
+ * @return {module:model/UpdateSubscriptionRequest} The populated UpdateSubscriptionRequest
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('subscription')) {
+ obj['subscription'] = Subscription.constructFromObject(data['subscription']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * The subscription object containing the current version, and fields to update. Unset fields will be left at their current server values, and JSON `null` values will be treated as a request to clear the relevant data.
+ * @member {module:model/Subscription} subscription
+ */
+exports.prototype['subscription'] = undefined;
+
+
+
+module.exports = exports;
+
+
+
diff --git a/src/model/UpdateSubscriptionResponse.js b/src/model/UpdateSubscriptionResponse.js
new file mode 100644
index 0000000..4443491
--- /dev/null
+++ b/src/model/UpdateSubscriptionResponse.js
@@ -0,0 +1,77 @@
+/**
+ * Square Connect API
+ * Client library for accessing the Square Connect APIs
+ *
+ * OpenAPI spec version: 2.0
+ * Contact: developers@squareup.com
+ *
+ * NOTE: This class is auto generated by the swagger code generator program.
+ * https://github.com/swagger-api/swagger-codegen.git
+ *
+ * Swagger Codegen version: 2.3.0-SNAPSHOT
+ *
+ */
+var ApiClient = require('../ApiClient');
+var Error = require('./Error');
+var Subscription = require('./Subscription');
+
+
+
+
+/**
+ * The UpdateSubscriptionResponse model module.
+ * Note: This model is in beta.
+ * @module model/UpdateSubscriptionResponse
+ */
+
+/**
+ * Constructs a new UpdateSubscriptionResponse
.
+ * Defines the fields that are included in the response from the [UpdateSubscription](#endpoint-subscriptions-updatesubscription) endpoint.
+ * @alias module:model/UpdateSubscriptionResponse
+ * @class
+ */
+var exports = function() {
+ var _this = this;
+
+
+
+};
+
+/**
+ * Constructs a UpdateSubscriptionResponse
from a plain JavaScript object, optionally creating a new instance.
+ * Copies all relevant properties from data
to obj
if supplied or a new instance if not.
+ * @param {Object} data The plain JavaScript object bearing properties of interest.
+ * @param {module:model/UpdateSubscriptionResponse} obj Optional instance to populate.
+ * @return {module:model/UpdateSubscriptionResponse} The populated UpdateSubscriptionResponse
instance.
+ */
+exports.constructFromObject = function(data, obj) {
+ if (data) {
+ obj = obj || new exports();
+
+ if (data.hasOwnProperty('errors')) {
+ obj['errors'] = ApiClient.convertToType(data['errors'], [Error]);
+ }
+ if (data.hasOwnProperty('subscription')) {
+ obj['subscription'] = Subscription.constructFromObject(data['subscription']);
+ }
+ }
+ return obj;
+}
+
+/**
+ * Information about errors encountered during the request.
+ * @member {Array.