culqi-node
Version:
Typescript wrapper for Culqi web services developed for Node.js with 0 runtime dependencies
73 lines (72 loc) • 2.11 kB
TypeScript
import { HttpRequestOptions } from './request';
export type Customer = {
object: string;
id: string;
creation_date: number;
email: string;
antifraud_details: {
country_code: string;
first_name: string;
last_name: string;
address_city: string;
address: string;
phone: string;
object: string;
};
metadata: Record<string, string>;
};
export type CreateCustomerRequest = {
first_name: string;
last_name: string;
email: string;
address: string;
address_city: string;
country_code: string;
phone_number: string;
};
export type GetCustomerRequest = {
id: string;
};
export type GetCustomersRequest = {
first_name?: string;
last_name?: string;
email?: string;
address?: string;
address_city?: string;
phone_number?: string;
country_code?: string;
limit?: string;
before?: string;
after?: string;
};
export type GetCustomersResponse = {
data: Customer[];
paging: {
previous: string;
next: string;
cursors: {
before: string;
after: string;
};
remaining_items: number;
};
};
export type UpdateCustomerRequest = {
id: string;
metadata?: Record<string, string>;
};
export type DeleteCustomerRequest = {
id: string;
};
export type DeleteCustomerResponse = {
id: string;
deleted: boolean;
merchant_message: string;
};
export declare const customers: {
createCustomer: (req: CreateCustomerRequest, extraHttpOptions?: Partial<HttpRequestOptions>) => Promise<Customer>;
getCustomer: (req: GetCustomerRequest, extraHttpOptions?: Partial<HttpRequestOptions>) => Promise<Customer>;
getCustomers: (req?: GetCustomersRequest, extraHttpOptions?: Partial<HttpRequestOptions>) => Promise<GetCustomersResponse>;
updateCustomer: (req: UpdateCustomerRequest, extraHttpOptions?: Partial<HttpRequestOptions>) => Promise<Customer>;
deleteCustomer: (req: DeleteCustomerRequest, extraHttpOptions?: Partial<HttpRequestOptions>) => Promise<DeleteCustomerResponse>;
};