Skip to content

Latest commit

 

History

History
510 lines (344 loc) · 14.9 KB

SubscriptionsApi.md

File metadata and controls

510 lines (344 loc) · 14.9 KB

Pipedrive.SubscriptionsApi

All URIs are relative to https://api.pipedrive.com/v1

Method HTTP request Description
addRecurringSubscription POST /subscriptions/recurring Add a recurring subscription
addSubscriptionInstallment POST /subscriptions/installment Add an installment subscription
cancelRecurringSubscription PUT /subscriptions/recurring/{id}/cancel Cancel a recurring subscription
deleteSubscription DELETE /subscriptions/{id} Delete a subscription
findSubscriptionByDeal GET /subscriptions/find/{dealId} Find subscription by deal
getSubscription GET /subscriptions/{id} Get details of a subscription
getSubscriptionPayments GET /subscriptions/{id}/payments Get all payments of a Subscription
updateRecurringSubscription PUT /subscriptions/recurring/{id} Update a recurring subscription
updateSubscriptionInstallment PUT /subscriptions/installment/{id} Update an installment subscription

addRecurringSubscription

SubscriptionsIdResponse addRecurringSubscription(opts)

Add a recurring subscription

Adds a new recurring Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let opts = {
  'subscriptionRecurringCreateRequest': new Pipedrive.SubscriptionRecurringCreateRequest() // SubscriptionRecurringCreateRequest | 
};
apiInstance.addRecurringSubscription(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
subscriptionRecurringCreateRequest SubscriptionRecurringCreateRequest [optional]

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

addSubscriptionInstallment

SubscriptionsIdResponse addSubscriptionInstallment(opts)

Add an installment subscription

Adds a new installment Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let opts = {
  'subscriptionInstallmentCreateRequest': new Pipedrive.SubscriptionInstallmentCreateRequest() // SubscriptionInstallmentCreateRequest | 
};
apiInstance.addSubscriptionInstallment(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
subscriptionInstallmentCreateRequest SubscriptionInstallmentCreateRequest [optional]

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

cancelRecurringSubscription

SubscriptionsIdResponse cancelRecurringSubscription(id, opts)

Cancel a recurring subscription

Cancels a recurring Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
let opts = {
  'subscriptionRecurringCancelRequest': new Pipedrive.SubscriptionRecurringCancelRequest() // SubscriptionRecurringCancelRequest | 
};
apiInstance.cancelRecurringSubscription(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription
subscriptionRecurringCancelRequest SubscriptionRecurringCancelRequest [optional]

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

deleteSubscription

SubscriptionsIdResponse deleteSubscription(id)

Delete a subscription

Marks an installment or a recurring Subscription as deleted.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
apiInstance.deleteSubscription(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

findSubscriptionByDeal

SubscriptionsIdResponse findSubscriptionByDeal(dealId)

Find subscription by deal

Returns details of an installment or a recurring Subscription by Deal ID.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let dealId = 56; // Number | ID of the Deal
apiInstance.findSubscriptionByDeal(dealId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
dealId Number ID of the Deal

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSubscription

SubscriptionsIdResponse getSubscription(id)

Get details of a subscription

Returns details of an installment or a recurring Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
apiInstance.getSubscription(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getSubscriptionPayments

PaymentsResponse getSubscriptionPayments(id)

Get all payments of a Subscription

Returns all payments of an installment or recurring Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
apiInstance.getSubscriptionPayments(id).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription

Return type

PaymentsResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

updateRecurringSubscription

SubscriptionsIdResponse updateRecurringSubscription(id, opts)

Update a recurring subscription

Updates a recurring Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
let opts = {
  'subscriptionRecurringUpdateRequest': new Pipedrive.SubscriptionRecurringUpdateRequest() // SubscriptionRecurringUpdateRequest | 
};
apiInstance.updateRecurringSubscription(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription
subscriptionRecurringUpdateRequest SubscriptionRecurringUpdateRequest [optional]

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

updateSubscriptionInstallment

SubscriptionsIdResponse updateSubscriptionInstallment(id, opts)

Update an installment subscription

Updates an installment Subscription.

Example

import Pipedrive from 'pipedrive';
let defaultClient = Pipedrive.ApiClient.instance;
// Configure API key authorization: api_key
let api_key = defaultClient.authentications['api_key'];
api_key.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//api_key.apiKeyPrefix = 'Token';
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';

let apiInstance = new Pipedrive.SubscriptionsApi();
let id = 56; // Number | ID of the Subscription
let opts = {
  'subscriptionInstallmentUpdateRequest': new Pipedrive.SubscriptionInstallmentUpdateRequest() // SubscriptionInstallmentUpdateRequest | 
};
apiInstance.updateSubscriptionInstallment(id, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
id Number ID of the Subscription
subscriptionInstallmentUpdateRequest SubscriptionInstallmentUpdateRequest [optional]

Return type

SubscriptionsIdResponse

Authorization

api_key, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json