@lomi./sdk
Version:
Official TypeScript SDK for the lomi. API
355 lines • 11.5 kB
JavaScript
import { OpenAPI } from '../core/OpenAPI.js';
import { request as __request } from '../core/request.js';
export class CoreService {
/**
* List customers
* Customer management - create and manage customer profiles
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listCustomers({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/customers',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create customer
* Customer management - create and manage customer profiles
* @returns customers Customer successfully created
* @throws ApiError
*/
static createCustomer({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/customers',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Retrieve customer
* Retrieve a specific customer by its unique identifier.
* @returns customers Customer retrieved successfully
* @throws ApiError
*/
static retrieveCustomer({ customerId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update customer
* Update a specific customer. Only provided fields will be updated.
* @returns customers Customer successfully updated
* @throws ApiError
*/
static updateCustomer({ customerId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
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 customer
* Delete a specific customer. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deleteCustomer({ customerId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/customers/{customer_id}',
path: {
'customer_id': customerId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* List payment requests
* Payment requests - create payment intents and track status
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listPaymentRequests({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/payment_requests',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Create payment request
* Payment requests - create payment intents and track status
* @returns payment_requests Payment_request successfully created
* @throws ApiError
*/
static createPaymentRequest({ requestBody, }) {
return __request(OpenAPI, {
method: 'POST',
url: '/payment_requests',
body: requestBody,
mediaType: 'application/json',
errors: {
400: `Bad request - Invalid input`,
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Retrieve payment request
* Retrieve a specific payment request by its unique identifier.
* @returns payment_requests Payment_request retrieved successfully
* @throws ApiError
*/
static retrievePaymentRequest({ requestId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/payment_requests/{request_id}',
path: {
'request_id': requestId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* Update payment request
* Update a specific payment request. Only provided fields will be updated.
* @returns payment_requests Payment_request successfully updated
* @throws ApiError
*/
static updatePaymentRequest({ requestId, requestBody, }) {
return __request(OpenAPI, {
method: 'PATCH',
url: '/payment_requests/{request_id}',
path: {
'request_id': requestId,
},
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 payment request
* Delete a specific payment request. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deletePaymentRequest({ requestId, }) {
return __request(OpenAPI, {
method: 'DELETE',
url: '/payment_requests/{request_id}',
path: {
'request_id': requestId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* List transactions
* Transaction history - view completed and pending transactions
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listTransactions({ limit = 20, offset, sort, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/transactions',
query: {
'limit': limit,
'offset': offset,
'sort': sort,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
500: `Internal server error`,
},
});
}
/**
* Retrieve transaction
* Retrieve a specific transaction by its unique identifier.
* @returns transactions Transaction retrieved successfully
* @throws ApiError
*/
static retrieveTransaction({ transactionId, }) {
return __request(OpenAPI, {
method: 'GET',
url: '/transactions/{transaction_id}',
path: {
'transaction_id': transactionId,
},
errors: {
401: `Unauthorized - Invalid or missing API key`,
404: `Not found - Resource does not exist`,
500: `Internal server error`,
},
});
}
/**
* List refunds
* Refund management - process and track refunds
* @returns any Successful response with paginated data
* @throws ApiError
*/
static listRefunds({ 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
* Refund management - process and track refunds
* @returns refunds Refund successfully created
* @throws ApiError
*/
static createRefund({ 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`,
},
});
}
/**
* Retrieve refund
* Retrieve a specific refund by its unique identifier.
* @returns refunds Refund retrieved successfully
* @throws ApiError
*/
static retrieveRefund({ 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. Only provided fields will be updated.
* @returns refunds Refund successfully updated
* @throws ApiError
*/
static updateRefund({ 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. This action cannot be undone.
* @returns void
* @throws ApiError
*/
static deleteRefund({ 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=CoreService.js.map