# PaycometRestApi.SusbcriptionsApi

All URIs are relative to *https://rest.paycomet.com*

Method | HTTP request | Description
------------- | ------------- | -------------
[**createSubscription**](SusbcriptionsApi.md#createSubscription) | **POST** /v1/subscription | Create susbcription payment
[**editSubscription**](SusbcriptionsApi.md#editSubscription) | **POST** /v1/subscription/{order}/edit | Edit susbcription payment.
[**infoSubscription**](SusbcriptionsApi.md#infoSubscription) | **POST** /v1/subscription/{order}/info | Gets susbcription info. If the susbscription is not a card subscription only the idUser is need. TokenUser is just for card subscriptions.
[**removeSubscription**](SusbcriptionsApi.md#removeSubscription) | **POST** /v1/subscription/{order}/remove | Remove susbcription payment. If the susbscription is not a card subscription only the idUser is need. TokenUser is just for card subscriptions.

<a name="createSubscription"></a>
# **createSubscription**
> InlineResponse20022 createSubscription(PAYCOMET_API_TOKEN, opts)

Create susbcription payment

Create subscription, create subscription token

### Example
```javascript
import {PaycometRestApi} from 'paycomet_rest_api';

let apiInstance = new PaycometRestApi.SusbcriptionsApi();
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Authorization privilege required)
let opts = { 
  'body': new PaycometRestApi.V1SubscriptionBody() // V1SubscriptionBody | 
};
apiInstance.createSubscription(PAYCOMET_API_TOKEN, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **PAYCOMET_API_TOKEN** | **String**| PAYCOMET API key (Authorization privilege required) | 
 **body** | [**V1SubscriptionBody**](V1SubscriptionBody.md)|  | [optional] 

### Return type

[**InlineResponse20022**](InlineResponse20022.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="editSubscription"></a>
# **editSubscription**
> InlineResponse20023 editSubscription(order, PAYCOMET_API_TOKEN, opts)

Edit susbcription payment.

Edit a subscription. The subscription is identified by the terminal, the payment method, the iduser and the original reference. The rest of the fields can be changed. Please note that changing an amount in a subscription may result in the bank rejecting the payment as the initial payment will not match the new one. To change the amount it is recommended to use the execute parameter. Even if the amount and currency are not changed they should be indicated with the original values

### Example
```javascript
import {PaycometRestApi} from 'paycomet_rest_api';

let apiInstance = new PaycometRestApi.SusbcriptionsApi();
let order = "order_example"; // String | 
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Authorization privilege required)
let opts = { 
  'body': new PaycometRestApi.OrderEditBody() // OrderEditBody | 
};
apiInstance.editSubscription(order, PAYCOMET_API_TOKEN, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **order** | **String**|  | 
 **PAYCOMET_API_TOKEN** | **String**| PAYCOMET API key (Authorization privilege required) | 
 **body** | [**OrderEditBody**](OrderEditBody.md)|  | [optional] 

### Return type

[**InlineResponse20023**](InlineResponse20023.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="infoSubscription"></a>
# **infoSubscription**
> InlineResponse20024 infoSubscription(order, PAYCOMET_API_TOKEN, opts)

Gets susbcription info. If the susbscription is not a card subscription only the idUser is need. TokenUser is just for card subscriptions.

Gets the subscription info. The subscription is identified by the terminal, the payment method, the iduser and the original reference.

### Example
```javascript
import {PaycometRestApi} from 'paycomet_rest_api';

let apiInstance = new PaycometRestApi.SusbcriptionsApi();
let order = "order_example"; // String | 
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Authorization privilege required)
let opts = { 
  'body': new PaycometRestApi.OrderInfoBody1() // OrderInfoBody1 | 
};
apiInstance.infoSubscription(order, PAYCOMET_API_TOKEN, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **order** | **String**|  | 
 **PAYCOMET_API_TOKEN** | **String**| PAYCOMET API key (Authorization privilege required) | 
 **body** | [**OrderInfoBody1**](OrderInfoBody1.md)|  | [optional] 

### Return type

[**InlineResponse20024**](InlineResponse20024.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="removeSubscription"></a>
# **removeSubscription**
> InlineResponse20024 removeSubscription(order, PAYCOMET_API_TOKEN, opts)

Remove susbcription payment. If the susbscription is not a card subscription only the idUser is need. TokenUser is just for card subscriptions.

Delete a subscription. The subscription is identified by the terminal, the payment method, the iduser and the original reference.

### Example
```javascript
import {PaycometRestApi} from 'paycomet_rest_api';

let apiInstance = new PaycometRestApi.SusbcriptionsApi();
let order = "order_example"; // String | 
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Authorization privilege required)
let opts = { 
  'body': new PaycometRestApi.OrderRemoveBody() // OrderRemoveBody | 
};
apiInstance.removeSubscription(order, PAYCOMET_API_TOKEN, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});
```

### Parameters

Name | Type | Description  | Notes
------------- | ------------- | ------------- | -------------
 **order** | **String**|  | 
 **PAYCOMET_API_TOKEN** | **String**| PAYCOMET API key (Authorization privilege required) | 
 **body** | [**OrderRemoveBody**](OrderRemoveBody.md)|  | [optional] 

### Return type

[**InlineResponse20024**](InlineResponse20024.md)

### Authorization

No authorization required

### HTTP request headers

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

