# PaycometRestApi.PreauthorizationsApi

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

Method | HTTP request | Description
------------- | ------------- | -------------
[**cancelPreauthorization**](PreauthorizationsApi.md#cancelPreauthorization) | **POST** /v1/payments/{order}/preauth/cancel | Cancel previous preauthorization
[**confirmPreauthorization**](PreauthorizationsApi.md#confirmPreauthorization) | **POST** /v1/payments/{order}/preauth/confirm | Confirm previous preauthorization
[**createPreauthorization**](PreauthorizationsApi.md#createPreauthorization) | **POST** /v1/payments/preauth | Create preauthorization
[**createPreauthorizationRtoken**](PreauthorizationsApi.md#createPreauthorizationRtoken) | **POST** /v1/payments/preauthrtoken | Creates a preauthorization by reference

<a name="cancelPreauthorization"></a>
# **cancelPreauthorization**
> InlineResponse20019 cancelPreauthorization(order, PAYCOMET_API_TOKEN, opts)

Cancel previous preauthorization

cancel_preauthorization

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

let apiInstance = new PaycometRestApi.PreauthorizationsApi();
let order = "order_example"; // String | 
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Preauthorization privilege required)
let opts = { 
  'body': new PaycometRestApi.PreauthCancelBody() // PreauthCancelBody | 
};
apiInstance.cancelPreauthorization(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 (Preauthorization privilege required) | 
 **body** | [**PreauthCancelBody**](PreauthCancelBody.md)|  | [optional] 

### Return type

[**InlineResponse20019**](InlineResponse20019.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="confirmPreauthorization"></a>
# **confirmPreauthorization**
> InlineResponse20020 confirmPreauthorization(order, PAYCOMET_API_TOKEN, opts)

Confirm previous preauthorization

confirm_preauthorization

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

let apiInstance = new PaycometRestApi.PreauthorizationsApi();
let order = "order_example"; // String | 
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Preauthorization privilege required)
let opts = { 
  'body': new PaycometRestApi.PreauthConfirmBody() // PreauthConfirmBody | 
};
apiInstance.confirmPreauthorization(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 (Preauthorization privilege required) | 
 **body** | [**PreauthConfirmBody**](PreauthConfirmBody.md)|  | [optional] 

### Return type

[**InlineResponse20020**](InlineResponse20020.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="createPreauthorization"></a>
# **createPreauthorization**
> InlineResponse20018 createPreauthorization(PAYCOMET_API_TOKEN, opts)

Create preauthorization

create_preauthorization

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

let apiInstance = new PaycometRestApi.PreauthorizationsApi();
let PAYCOMET_API_TOKEN = "PAYCOMET_API_TOKEN_example"; // String | PAYCOMET API key (Preauthorization privilege required)
let opts = { 
  'body': new PaycometRestApi.PaymentsPreauthBody() // PaymentsPreauthBody | 
};
apiInstance.createPreauthorization(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 (Preauthorization privilege required) | 
 **body** | [**PaymentsPreauthBody**](PaymentsPreauthBody.md)|  | [optional] 

### Return type

[**InlineResponse20018**](InlineResponse20018.md)

### Authorization

No authorization required

### HTTP request headers

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

<a name="createPreauthorizationRtoken"></a>
# **createPreauthorizationRtoken**
> InlineResponse20021 createPreauthorizationRtoken(opts)

Creates a preauthorization by reference

Creates a preauthorization with reference.

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

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

### Parameters

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

### Return type

[**InlineResponse20021**](InlineResponse20021.md)

### Authorization

No authorization required

### HTTP request headers

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

