@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
50 lines • 2.75 kB
TypeScript
import { APIResource, type RequestOptions, type WithResponse } from "../../core";
import type { Customer, ErrorExtended, PaymentInstrumentResponse, PersonalDetails } from "../../types";
export type CreateCustomerError = ErrorExtended | {
instance: string;
error_code: string;
error_message: string;
};
export type UpdateCustomerParams = {
personal_details?: PersonalDetails;
};
export type ListPaymentInstrumentsResponse = PaymentInstrumentResponse[];
/**
* API resource for the Customers endpoints.
*
* Allow your regular customers to save their information with the Customers model.
*
* This will prevent re-entering payment instrument information for recurring payments on your platform.
*
* Depending on the needs you can allow, creating, listing or deactivating payment instruments & creating, retrieving and updating customers.
*/
export declare class Customers extends APIResource {
/**
* Creates a new saved customer resource which you can later manipulate and save payment instruments to.
*/
create(body: Customer, options?: RequestOptions): Promise<Customer>;
createWithResponse(body: Customer, options?: RequestOptions): Promise<WithResponse<Customer>>;
/**
* Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.
*/
get(customerId: string, options?: RequestOptions): Promise<Customer>;
getWithResponse(customerId: string, options?: RequestOptions): Promise<WithResponse<Customer>>;
/**
* Updates an identified saved customer resource's personal details.
*
* The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.
*/
update(customerId: string, body: UpdateCustomerParams, options?: RequestOptions): Promise<Customer>;
updateWithResponse(customerId: string, body: UpdateCustomerParams, options?: RequestOptions): Promise<WithResponse<Customer>>;
/**
* Lists all payment instrument resources that are saved for an identified customer.
*/
listPaymentInstruments(customerId: string, options?: RequestOptions): Promise<PaymentInstrumentResponse[]>;
listPaymentInstrumentsWithResponse(customerId: string, options?: RequestOptions): Promise<WithResponse<PaymentInstrumentResponse[]>>;
/**
* Deactivates an identified card payment instrument resource for a customer.
*/
deactivatePaymentInstrument(customerId: string, token: string, options?: RequestOptions): Promise<void>;
deactivatePaymentInstrumentWithResponse(customerId: string, token: string, options?: RequestOptions): Promise<WithResponse<void>>;
}
//# sourceMappingURL=index.d.ts.map