@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
108 lines • 3.21 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class RefundService {
/**
* List refunds
* Retrieve a paginated list of refunds
* @returns any Successful response
* @throws ApiError
*/
static getRefunds({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/refunds',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create refund
* Create a new refund
* @returns refunds Successfully created
* @throws ApiError
*/
static postRefunds({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/refunds',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Get refund
* Retrieve a specific refund by ID
* @returns refunds Successful response
* @throws ApiError
*/
static getRefunds1({ refundId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/refunds/{refund_id}',
path: {
'refund_id': refundId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update refund
* Update a specific refund
* @returns refunds Successfully updated
* @throws ApiError
*/
static patchRefunds({ refundId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/refunds/{refund_id}',
path: {
'refund_id': refundId,
},
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Delete refund
* Delete a specific refund
* @returns void
* @throws ApiError
*/
static deleteRefunds({ refundId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/refunds/{refund_id}',
path: {
'refund_id': refundId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
}
//# sourceMappingURL=RefundService.js.map