UNPKG

@sumup/sdk

Version:

The official TypeScript SDK for the SumUp API

1 lines 85.1 kB
{"version":3,"file":"index.cjs","sources":["webpack://webpack/runtime/define_property_getters","webpack://webpack/runtime/has_own_property","webpack://webpack/runtime/make_namespace_object","../src/core.ts","../src/runtime.ts","../src/client.ts","../src/resources/checkouts/index.ts","../src/resources/customers/index.ts","../src/resources/members/index.ts","../src/resources/memberships/index.ts","../src/resources/merchants/index.ts","../src/resources/payouts/index.ts","../src/resources/readers/index.ts","../src/resources/receipts/index.ts","../src/resources/roles/index.ts","../src/resources/transactions/index.ts","../src/index.ts"],"sourcesContent":["__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n }\n }\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport type { SumUp } from \"./index\";\n\nexport class APIResource {\n protected _client: SumUp;\n\n constructor(client: SumUp) {\n this._client = client;\n }\n}\n\n// has to be any. the particular query params types don't like unknown\n// biome-ignore lint/suspicious/noExplicitAny: any, but only for tests\ntype QueryParams = Record<string, any>;\n\ntype HTTPMethod = \"GET\" | \"POST\" | \"PUT\" | \"PATCH\" | \"DELETE\";\n\n/**\n * SDK-specific options that can be passed to any generated request method.\n */\nexport type RequestOptions = {\n /**\n * Optional bearer authorization value to apply to the request, for example\n * `Bearer <access-token>`. When provided, it overrides any default\n * Authorization header configured on the client.\n */\n authorization?: string;\n headers?: HeadersInit;\n host?: string;\n maxRetries?: number;\n signal?: AbortSignal | null;\n timeout?: number;\n};\n\n/** All arguments to `request()` */\nexport type FullRequestOptions = RequestOptions & {\n path: string;\n query?: QueryParams;\n body?: unknown;\n method?: HTTPMethod;\n};\n\nexport class SumUpError extends Error {}\n\nexport class APIError<T> extends SumUpError {\n /* HTTP status for the response that caused the error */\n readonly status: number;\n /* JSON body of the response that caused the error */\n readonly error: T | string;\n /* Raw response of the API */\n readonly response: Response;\n\n constructor(status: number, error: T | string, response: Response) {\n const message = typeof error === \"string\" ? error : JSON.stringify(error);\n super(`${status}: ${message}`);\n this.status = status;\n this.error = error;\n this.response = response;\n }\n}\n\nexport type WithResponse<T> = {\n data: T;\n response: Response;\n};\n\nexport async function parseResponse<T>(res: Response): Promise<T> {\n if (res.status === 204 || res.status === 205) {\n return undefined as T;\n }\n\n const contentLength = res.headers.get(\"content-length\");\n if (contentLength === \"0\") {\n return undefined as T;\n }\n\n const contentType = res.headers.get(\"content-type\");\n const isJSON = contentType?.includes(\"json\");\n if (!isJSON) {\n throw new SumUpError(\"Unexpected non-json response.\");\n }\n\n return await res.json();\n}\n","import { API_VERSION } from \"./api-version\";\nimport { VERSION } from \"./version\";\n\nconst UNKNOWN = \"unknown\";\n\ntype Arch = \"x86_64\" | \"x86\" | \"arm\" | \"arm64\" | string;\n\ntype RuntimeInfo = {\n runtime: string;\n runtimeVersion: string;\n os: string;\n arch: Arch;\n};\n\nconst normalizeArch = (arch: string): Arch => {\n const lower = arch.toLowerCase();\n if (lower === \"x64\" || lower === \"x86_64\" || lower === \"amd64\")\n return \"x86_64\";\n if (lower === \"ia32\" || lower === \"x86\" || lower === \"x32\") return \"x86\";\n if (lower === \"aarch64\" || lower === \"arm64\") return \"arm64\";\n if (lower === \"arm\") return \"arm\";\n return lower || UNKNOWN;\n};\n\nlet cachedRuntimeInfo: RuntimeInfo | undefined;\n\nfunction getRuntimeInfo(): RuntimeInfo {\n if (cachedRuntimeInfo) {\n return cachedRuntimeInfo;\n }\n\n const isVercel = typeof process !== \"undefined\" && process.env.VERCEL === \"1\";\n\n const globalAny = globalThis as {\n process?: {\n versions?: { node?: string };\n version?: string;\n platform?: string;\n arch?: string;\n };\n Deno?: {\n version?: { deno?: string };\n build?: { os?: string; arch?: string };\n };\n Bun?: {\n version?: string;\n };\n EdgeRuntime?: string;\n navigator?: {\n userAgent?: string;\n platform?: string;\n userAgentData?: { platform?: string };\n };\n };\n\n if (globalAny.Bun?.version) {\n cachedRuntimeInfo = {\n runtime: \"bun\",\n runtimeVersion: globalAny.Bun.version || UNKNOWN,\n os: globalAny.process?.platform || UNKNOWN,\n arch: normalizeArch(globalAny.process?.arch || \"\"),\n };\n return cachedRuntimeInfo;\n }\n\n if (globalAny.Deno?.version?.deno) {\n cachedRuntimeInfo = {\n runtime: \"deno\",\n runtimeVersion: globalAny.Deno.version.deno || UNKNOWN,\n os: globalAny.Deno.build?.os || UNKNOWN,\n arch: normalizeArch(globalAny.Deno.build?.arch || \"\"),\n };\n return cachedRuntimeInfo;\n }\n\n if (globalAny.process?.versions?.node) {\n cachedRuntimeInfo = {\n runtime: isVercel ? \"vercel\" : \"node\",\n runtimeVersion: globalAny.process.version || UNKNOWN,\n os: globalAny.process.platform || UNKNOWN,\n arch: normalizeArch(globalAny.process.arch || \"\"),\n };\n return cachedRuntimeInfo;\n }\n\n if (globalAny.EdgeRuntime) {\n cachedRuntimeInfo = {\n runtime: isVercel ? \"vercel-edge\" : \"edge\",\n runtimeVersion: globalAny.process?.version || UNKNOWN,\n os: UNKNOWN,\n arch: `${globalAny.EdgeRuntime}`,\n };\n return cachedRuntimeInfo;\n }\n\n if (globalAny.navigator) {\n const userAgent = globalAny.navigator.userAgent || \"\";\n if (userAgent.includes(\"Cloudflare-Workers\")) {\n cachedRuntimeInfo = {\n runtime: \"cloudflare-workers\",\n runtimeVersion: userAgent,\n os: UNKNOWN,\n arch: UNKNOWN,\n };\n return cachedRuntimeInfo;\n }\n\n const platform =\n globalAny.navigator.userAgentData?.platform ||\n globalAny.navigator.platform ||\n \"\";\n\n cachedRuntimeInfo = {\n runtime: \"browser\",\n runtimeVersion: UNKNOWN,\n os: platform || UNKNOWN,\n arch: UNKNOWN,\n };\n return cachedRuntimeInfo;\n }\n\n cachedRuntimeInfo = {\n runtime: UNKNOWN,\n runtimeVersion: UNKNOWN,\n os: UNKNOWN,\n arch: UNKNOWN,\n };\n return cachedRuntimeInfo;\n}\n\nexport function buildRuntimeHeaders(): Record<string, string> {\n const { runtime, runtimeVersion, os, arch } = getRuntimeInfo();\n\n return {\n \"X-Sumup-Api-Version\": API_VERSION,\n \"X-Sumup-Lang\": \"javascript\",\n \"X-Sumup-Package-Version\": VERSION,\n \"X-Sumup-Os\": os,\n \"X-Sumup-Arch\": arch,\n \"X-Sumup-Runtime\": runtime,\n \"X-Sumup-Runtime-Version\": runtimeVersion,\n };\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport * as Core from \"./core\";\nimport { buildRuntimeHeaders } from \"./runtime\";\nimport { VERSION } from \"./version\";\n\nexport type APIConfig = {\n apiKey?: string;\n host?: string;\n baseParams?: Core.RequestOptions;\n maxRetries?: number;\n timeout?: number;\n};\n\nexport class HTTPClient {\n host: string;\n apiKey?: string;\n baseParams: Core.RequestOptions;\n\n constructor({\n apiKey,\n host = \"https://api.sumup.com\",\n baseParams = {},\n maxRetries = 0,\n timeout,\n }: APIConfig = {}) {\n this.host = host;\n this.apiKey = apiKey;\n\n const headers = new Headers({\n \"Accept\": \"application/problem+json, application/json\",\n \"Content-Type\": \"application/json\",\n \"User-Agent\": `sumup-ts/v${VERSION}`,\n ...buildRuntimeHeaders(),\n });\n if (apiKey) {\n headers.append(\"Authorization\", `Bearer ${apiKey}`);\n }\n this.baseParams = mergeParams({ headers, maxRetries, timeout }, baseParams);\n }\n\n public get<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<R> {\n return this.request<R>({\n method: \"GET\",\n ...params,\n });\n }\n\n public getWithResponse<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<Core.WithResponse<R>> {\n return this.requestWithResponse<R>({\n method: \"GET\",\n ...params,\n });\n }\n\n public post<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<R> {\n return this.request<R>({\n method: \"POST\",\n ...params,\n });\n }\n\n public postWithResponse<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<Core.WithResponse<R>> {\n return this.requestWithResponse<R>({\n method: \"POST\",\n ...params,\n });\n }\n\n public put<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<R> {\n return this.request<R>({\n method: \"PUT\",\n ...params,\n });\n }\n\n public putWithResponse<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<Core.WithResponse<R>> {\n return this.requestWithResponse<R>({\n method: \"PUT\",\n ...params,\n });\n }\n\n public patch<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<R> {\n return this.request<R>({\n method: \"PATCH\",\n ...params,\n });\n }\n\n public patchWithResponse<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<Core.WithResponse<R>> {\n return this.requestWithResponse<R>({\n method: \"PATCH\",\n ...params,\n });\n }\n\n public delete<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<R> {\n return this.request<R>({\n method: \"DELETE\",\n ...params,\n });\n }\n\n public deleteWithResponse<R>({\n ...params\n }: Omit<Core.FullRequestOptions, \"method\">): Promise<Core.WithResponse<R>> {\n return this.requestWithResponse<R>({\n method: \"DELETE\",\n ...params,\n });\n }\n\n public request<T>({ ...params }: Core.FullRequestOptions): Promise<T> {\n return this.requestWithResponse<T>(params).then(({ data }) => data);\n }\n\n public async requestWithResponse<T>({\n body,\n path,\n query,\n host: hostOverride,\n ...requestOptions\n }: Core.FullRequestOptions): Promise<Core.WithResponse<T>> {\n const host = hostOverride || this.host;\n const url = new URL(\n host +\n (host.endsWith(\"/\") && path.startsWith(\"/\") ? path.slice(1) : path),\n );\n if (typeof query === \"object\" && query && !Array.isArray(query)) {\n url.search = this.stringifyQuery(query as Record<string, unknown>);\n }\n const mergedOptions = mergeParams(this.baseParams, requestOptions);\n const { maxRetries, timeout, ...fetchParams } = mergedOptions;\n const init = {\n ...fetchParams,\n body: JSON.stringify(body),\n };\n const response = await this.do(url, init, {\n maxRetries,\n signal: fetchParams.signal,\n timeout,\n });\n const data = await Core.parseResponse<T>(response.clone());\n\n return { data, response };\n }\n\n protected async do(\n input: URL,\n init: RequestInit,\n options: {\n maxRetries?: number;\n signal?: AbortSignal | null;\n timeout?: number;\n },\n ): Promise<Response> {\n const maxRetries = options.maxRetries ?? 0;\n\n for (let attempt = 0; ; attempt++) {\n const { cleanup, didTimeout, signal } = withTimeoutSignal(\n options.signal,\n options.timeout,\n );\n\n try {\n const res = await fetch(input, { ...init, signal });\n\n if (!res.ok) {\n if (attempt < maxRetries && isRetryableStatus(res.status)) {\n continue;\n }\n\n const contentType = res.headers.get(\"content-type\");\n const isJSON = contentType?.includes(\"json\");\n throw new Core.APIError(\n res.status,\n isJSON ? await res.json() : await res.text(),\n res,\n );\n }\n\n return res;\n } catch (error) {\n if (attempt < maxRetries && isRetryableError(error, options.signal)) {\n continue;\n }\n if (didTimeout()) {\n throw new Core.SumUpError(\n `Request timed out after ${options.timeout}ms.`,\n );\n }\n throw error;\n } finally {\n cleanup();\n }\n }\n }\n\n protected stringifyQuery(query: Record<string, unknown>): string {\n return Object.entries(query)\n .filter(([_, value]) => typeof value !== \"undefined\")\n .map(([key, value]) => {\n if (\n typeof value === \"string\" ||\n typeof value === \"number\" ||\n typeof value === \"boolean\"\n ) {\n return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;\n }\n if (value === null) {\n return `${encodeURIComponent(key)}=`;\n }\n if (Array.isArray(value)) {\n return value\n .map((v) => `${encodeURIComponent(key)}=${encodeURIComponent(v)}`)\n .join(\"&\");\n }\n throw new Error(\n `Cannot stringify type ${typeof value}; Expected string, number, boolean, or null.`,\n );\n })\n .join(\"&\");\n }\n}\n\nexport function mergeParams(\n a: Core.RequestOptions,\n b: Core.RequestOptions,\n): Core.RequestOptions {\n const {\n authorization: defaultAuthorization,\n headers: defaultHeaders,\n ...defaultParams\n } = a;\n const {\n authorization: overrideAuthorization,\n headers: overrideHeaders,\n ...overrideParams\n } = b;\n // calling `new Headers()` normalizes `HeadersInit`, which could be a Headers\n // object, a plain object, or an array of tuples\n const headers = new Headers(defaultHeaders);\n for (const [key, value] of new Headers(overrideHeaders).entries()) {\n headers.set(key, value);\n }\n const authorization = overrideAuthorization ?? defaultAuthorization;\n if (authorization) {\n headers.set(\"Authorization\", authorization);\n }\n\n return { ...defaultParams, ...overrideParams, headers };\n}\n\nfunction isRetryableStatus(status: number): boolean {\n return status === 408 || status === 409 || status === 429 || status >= 500;\n}\n\nfunction isRetryableError(\n error: unknown,\n signal?: AbortSignal | null,\n): boolean {\n if (signal?.aborted) {\n return false;\n }\n return error instanceof TypeError || isAbortError(error);\n}\n\nfunction isAbortError(error: unknown): boolean {\n return error instanceof DOMException\n ? error.name === \"AbortError\"\n : error instanceof Error && error.name === \"AbortError\";\n}\n\nfunction withTimeoutSignal(\n signal?: AbortSignal | null,\n timeout?: number,\n): {\n cleanup: () => void;\n didTimeout: () => boolean;\n signal: AbortSignal | undefined;\n} {\n if (!signal && typeof timeout === \"undefined\") {\n return {\n cleanup: () => {},\n didTimeout: () => false,\n signal: undefined,\n };\n }\n\n const controller = new AbortController();\n let timedOut = false;\n\n const onAbort = () => {\n controller.abort(signal?.reason);\n };\n\n if (signal) {\n if (signal.aborted) {\n onAbort();\n } else {\n signal.addEventListener(\"abort\", onAbort, { once: true });\n }\n }\n\n const timeoutId =\n typeof timeout === \"number\"\n ? setTimeout(() => {\n timedOut = true;\n controller.abort(\n new Core.SumUpError(`Request timed out after ${timeout}ms.`),\n );\n }, timeout)\n : undefined;\n\n return {\n cleanup: () => {\n if (typeof timeoutId !== \"undefined\") {\n clearTimeout(timeoutId);\n }\n signal?.removeEventListener(\"abort\", onAbort);\n },\n didTimeout: () => timedOut,\n signal: controller.signal,\n };\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type {\n Checkout,\n CheckoutAccepted,\n CheckoutCreateRequest,\n CheckoutSuccess,\n ErrorBody,\n ErrorExtended,\n ProcessCheckout,\n} from \"../../types\";\nexport type GetPaymentMethodsQueryParams = {\n amount?: number;\n currency?: string;\n};\n\nexport type GetPaymentMethodsResponse = {\n available_payment_methods?: {\n /**\n * The ID of the payment method.\n */\n id: string;\n }[];\n};\n\nexport type ListCheckoutsQueryParams = {\n checkout_reference?: string;\n};\n\nexport type ListCheckoutsResponse = CheckoutSuccess[];\n\nexport type ProcessCheckoutError =\n | ErrorExtended /**\n * List of error messages.\n */\n | ErrorExtended[];\n\nexport type CreateApplePaySessionParams = {\n /**\n * the context to create this apple pay session.\n */\n context: string;\n /**\n * The target url to create this apple pay session.\n */\n target: string;\n};\n\nexport type CreateApplePaySessionResponse = Record<string, unknown>;\n\nexport type CreateApplePaySessionError =\n | ErrorBody /**\n * List of error messages.\n */\n | ErrorBody[];\n\n/**\n * API resource for the Checkouts endpoints.\n *\n * Checkouts represent online payment sessions that you create before attempting to charge a payer. A checkout captures the payment intent, such as the amount, currency, merchant, and optional customer or redirect settings, and then moves through its lifecycle as you process it.\n *\n * Use this tag to:\n * - create a checkout before collecting or confirming payment details\n * - process the checkout with a card, saved card, wallet, or supported alternative payment method\n * - retrieve or list checkouts to inspect their current state and associated payment attempts\n * - deactivate a checkout that should no longer be used\n *\n * Typical workflow:\n * - create a checkout with the order amount, currency, and merchant information\n * - process the checkout through SumUp client tools such as the [Payment Widget and Swift Checkout SDK](https://developer.sumup.com/online-payments/checkouts)\n * - retrieve the checkout or use the Transactions endpoints to inspect the resulting payment record\n *\n * Checkouts are used to initiate and orchestrate online payments. Transactions remain the authoritative record of the resulting payment outcome.\n */\nexport class Checkouts extends APIResource {\n /**\n * Get payment methods available for the given merchant to use with a checkout.\n */\n listAvailablePaymentMethods(\n merchantCode: string,\n query?: GetPaymentMethodsQueryParams,\n options?: RequestOptions,\n ): Promise<GetPaymentMethodsResponse> {\n return this._client.get<GetPaymentMethodsResponse>({\n path: `/v0.1/merchants/${merchantCode}/payment-methods`,\n query,\n ...options,\n });\n }\n\n listAvailablePaymentMethodsWithResponse(\n merchantCode: string,\n query?: GetPaymentMethodsQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<GetPaymentMethodsResponse>> {\n return this._client.getWithResponse<GetPaymentMethodsResponse>({\n path: `/v0.1/merchants/${merchantCode}/payment-methods`,\n query,\n ...options,\n });\n }\n\n /**\n * Lists created checkout resources according to the applied `checkout_reference`.\n */\n list(\n query?: ListCheckoutsQueryParams,\n options?: RequestOptions,\n ): Promise<CheckoutSuccess[]> {\n return this._client.get<CheckoutSuccess[]>({\n path: `/v0.1/checkouts`,\n query,\n ...options,\n });\n }\n\n listWithResponse(\n query?: ListCheckoutsQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<CheckoutSuccess[]>> {\n return this._client.getWithResponse<CheckoutSuccess[]>({\n path: `/v0.1/checkouts`,\n query,\n ...options,\n });\n }\n\n /**\n * Creates a new payment checkout resource. The unique `checkout_reference` created by this request, is used for further manipulation of the checkout.\n *\n * For 3DS checkouts, add the `redirect_url` parameter to your request body schema.\n * To use the [Hosted Checkout](https://developer.sumup.com/online-payments/checkouts/hosted-checkout/) page, set the `hosted_checkout.enabled` to `true`.\n *\n * Follow by processing a checkout to charge the provided payment instrument.\n */\n create(\n body: CheckoutCreateRequest,\n options?: RequestOptions,\n ): Promise<Checkout> {\n return this._client.post<Checkout>({\n path: `/v0.1/checkouts`,\n body,\n ...options,\n });\n }\n\n createWithResponse(\n body: CheckoutCreateRequest,\n options?: RequestOptions,\n ): Promise<WithResponse<Checkout>> {\n return this._client.postWithResponse<Checkout>({\n path: `/v0.1/checkouts`,\n body,\n ...options,\n });\n }\n\n /**\n * Retrieves an identified checkout resource. Use this request after processing a checkout to confirm its status and inform the end user respectively.\n */\n get(id: string, options?: RequestOptions): Promise<CheckoutSuccess> {\n return this._client.get<CheckoutSuccess>({\n path: `/v0.1/checkouts/${id}`,\n ...options,\n });\n }\n\n getWithResponse(\n id: string,\n options?: RequestOptions,\n ): Promise<WithResponse<CheckoutSuccess>> {\n return this._client.getWithResponse<CheckoutSuccess>({\n path: `/v0.1/checkouts/${id}`,\n ...options,\n });\n }\n\n /**\n * Processing a checkout will attempt to charge the provided payment instrument for the amount of the specified checkout resource initiated in the `Create a checkout` endpoint.\n *\n * Follow this request with `Retrieve a checkout` to confirm its status.\n */\n process(\n id: string,\n body: ProcessCheckout,\n options?: RequestOptions,\n ): Promise<CheckoutSuccess | CheckoutAccepted> {\n return this._client.put<CheckoutSuccess | CheckoutAccepted>({\n path: `/v0.1/checkouts/${id}`,\n body,\n ...options,\n });\n }\n\n processWithResponse(\n id: string,\n body: ProcessCheckout,\n options?: RequestOptions,\n ): Promise<WithResponse<CheckoutSuccess | CheckoutAccepted>> {\n return this._client.putWithResponse<CheckoutSuccess | CheckoutAccepted>({\n path: `/v0.1/checkouts/${id}`,\n body,\n ...options,\n });\n }\n\n /**\n * Deactivates an identified checkout resource. If the checkout has already been processed it can not be deactivated.\n */\n deactivate(id: string, options?: RequestOptions): Promise<Checkout> {\n return this._client.delete<Checkout>({\n path: `/v0.1/checkouts/${id}`,\n ...options,\n });\n }\n\n deactivateWithResponse(\n id: string,\n options?: RequestOptions,\n ): Promise<WithResponse<Checkout>> {\n return this._client.deleteWithResponse<Checkout>({\n path: `/v0.1/checkouts/${id}`,\n ...options,\n });\n }\n\n /**\n * Creates an Apple Pay merchant session for the specified checkout.\n *\n * Use this endpoint after the customer selects Apple Pay and before calling\n * `ApplePaySession.completeMerchantValidation(...)` in the browser.\n * SumUp validates the merchant session request and returns the Apple Pay\n * session object that your frontend should pass to Apple's JavaScript API.\n *\n */\n createApplePaySession(\n id: string,\n body?: CreateApplePaySessionParams,\n options?: RequestOptions,\n ): Promise<CreateApplePaySessionResponse> {\n return this._client.put<CreateApplePaySessionResponse>({\n path: `/v0.2/checkouts/${id}/apple-pay-session`,\n body,\n ...options,\n });\n }\n\n createApplePaySessionWithResponse(\n id: string,\n body?: CreateApplePaySessionParams,\n options?: RequestOptions,\n ): Promise<WithResponse<CreateApplePaySessionResponse>> {\n return this._client.putWithResponse<CreateApplePaySessionResponse>({\n path: `/v0.2/checkouts/${id}/apple-pay-session`,\n body,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type {\n Customer,\n ErrorExtended,\n PaymentInstrumentResponse,\n PersonalDetails,\n} from \"../../types\";\nexport type CreateCustomerError =\n | ErrorExtended\n | { instance: string; error_code: string; error_message: string };\n\nexport type UpdateCustomerParams = { personal_details?: PersonalDetails };\n\nexport type ListPaymentInstrumentsResponse = PaymentInstrumentResponse[];\n\n/**\n * API resource for the Customers endpoints.\n *\n * Allow your regular customers to save their information with the Customers model.\n *\n * This will prevent re-entering payment instrument information for recurring payments on your platform.\n *\n * Depending on the needs you can allow, creating, listing or deactivating payment instruments & creating, retrieving and updating customers.\n */\nexport class Customers extends APIResource {\n /**\n * Creates a new saved customer resource which you can later manipulate and save payment instruments to.\n */\n create(body: Customer, options?: RequestOptions): Promise<Customer> {\n return this._client.post<Customer>({\n path: `/v0.1/customers`,\n body,\n ...options,\n });\n }\n\n createWithResponse(\n body: Customer,\n options?: RequestOptions,\n ): Promise<WithResponse<Customer>> {\n return this._client.postWithResponse<Customer>({\n path: `/v0.1/customers`,\n body,\n ...options,\n });\n }\n\n /**\n * Retrieves an identified saved customer resource through the unique `customer_id` parameter, generated upon customer creation.\n */\n get(customerId: string, options?: RequestOptions): Promise<Customer> {\n return this._client.get<Customer>({\n path: `/v0.1/customers/${customerId}`,\n ...options,\n });\n }\n\n getWithResponse(\n customerId: string,\n options?: RequestOptions,\n ): Promise<WithResponse<Customer>> {\n return this._client.getWithResponse<Customer>({\n path: `/v0.1/customers/${customerId}`,\n ...options,\n });\n }\n\n /**\n * Updates an identified saved customer resource's personal details.\n *\n * The request only overwrites the parameters included in the request, all other parameters will remain with their initially assigned values.\n */\n update(\n customerId: string,\n body: UpdateCustomerParams,\n options?: RequestOptions,\n ): Promise<Customer> {\n return this._client.put<Customer>({\n path: `/v0.1/customers/${customerId}`,\n body,\n ...options,\n });\n }\n\n updateWithResponse(\n customerId: string,\n body: UpdateCustomerParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Customer>> {\n return this._client.putWithResponse<Customer>({\n path: `/v0.1/customers/${customerId}`,\n body,\n ...options,\n });\n }\n\n /**\n * Lists all payment instrument resources that are saved for an identified customer.\n */\n listPaymentInstruments(\n customerId: string,\n options?: RequestOptions,\n ): Promise<PaymentInstrumentResponse[]> {\n return this._client.get<PaymentInstrumentResponse[]>({\n path: `/v0.1/customers/${customerId}/payment-instruments`,\n ...options,\n });\n }\n\n listPaymentInstrumentsWithResponse(\n customerId: string,\n options?: RequestOptions,\n ): Promise<WithResponse<PaymentInstrumentResponse[]>> {\n return this._client.getWithResponse<PaymentInstrumentResponse[]>({\n path: `/v0.1/customers/${customerId}/payment-instruments`,\n ...options,\n });\n }\n\n /**\n * Deactivates an identified card payment instrument resource for a customer.\n */\n deactivatePaymentInstrument(\n customerId: string,\n token: string,\n options?: RequestOptions,\n ): Promise<void> {\n return this._client.delete<void>({\n path: `/v0.1/customers/${customerId}/payment-instruments/${token}`,\n ...options,\n });\n }\n\n deactivatePaymentInstrumentWithResponse(\n customerId: string,\n token: string,\n options?: RequestOptions,\n ): Promise<WithResponse<void>> {\n return this._client.deleteWithResponse<void>({\n path: `/v0.1/customers/${customerId}/payment-instruments/${token}`,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type {\n Attributes,\n Member,\n MembershipStatus,\n Metadata,\n} from \"../../types\";\nexport type ListMerchantMembersQueryParams = {\n offset?: number;\n limit?: number;\n scroll?: boolean;\n email?: string;\n \"user.id\"?: string;\n status?: MembershipStatus;\n roles?: string[];\n};\n\nexport type ListMerchantMembersResponse = {\n items: Member[];\n total_count?: number;\n};\n\nexport type CreateMerchantMemberParams = {\n /**\n * True if the user is managed by the merchant. In this case, we'll created a virtual user with the provided password and nickname.\n */\n is_managed_user?: boolean;\n /**\n * Email address of the member to add.\n */\n email: string;\n /**\n * Password of the member to add. Only used if `is_managed_user` is true. In the case of service accounts, the password is not used and can not be defined by the caller.\n */\n password?: string;\n /**\n * Nickname of the member to add. Only used if `is_managed_user` is true. Used for display purposes only.\n */\n nickname?: string;\n /**\n * List of roles to assign to the new member.\n */\n roles: string[];\n metadata?: Metadata;\n attributes?: Attributes;\n};\n\nexport type UpdateMerchantMemberParams = {\n roles?: string[];\n metadata?: Metadata;\n attributes?: Attributes;\n /**\n * Allows you to update user data of managed users.\n */\n user?: {\n /**\n * User's preferred name. Used for display purposes only.\n */\n nickname?: string;\n /**\n * Password of the member to add. Only used if `is_managed_user` is true.\n */\n password?: string;\n };\n};\n\n/**\n * API resource for the Members endpoints.\n *\n * Endpoints to manage account members. Members are users that have membership within merchant accounts.\n */\nexport class Members extends APIResource {\n /**\n * Lists merchant members.\n */\n list(\n merchantCode: string,\n query?: ListMerchantMembersQueryParams,\n options?: RequestOptions,\n ): Promise<ListMerchantMembersResponse> {\n return this._client.get<ListMerchantMembersResponse>({\n path: `/v0.1/merchants/${merchantCode}/members`,\n query,\n ...options,\n });\n }\n\n listWithResponse(\n merchantCode: string,\n query?: ListMerchantMembersQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<ListMerchantMembersResponse>> {\n return this._client.getWithResponse<ListMerchantMembersResponse>({\n path: `/v0.1/merchants/${merchantCode}/members`,\n query,\n ...options,\n });\n }\n\n /**\n * Create a merchant member.\n */\n create(\n merchantCode: string,\n body: CreateMerchantMemberParams,\n options?: RequestOptions,\n ): Promise<Member> {\n return this._client.post<Member>({\n path: `/v0.1/merchants/${merchantCode}/members`,\n body,\n ...options,\n });\n }\n\n createWithResponse(\n merchantCode: string,\n body: CreateMerchantMemberParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Member>> {\n return this._client.postWithResponse<Member>({\n path: `/v0.1/merchants/${merchantCode}/members`,\n body,\n ...options,\n });\n }\n\n /**\n * Retrieve a merchant member.\n */\n get(\n merchantCode: string,\n memberId: string,\n options?: RequestOptions,\n ): Promise<Member> {\n return this._client.get<Member>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n ...options,\n });\n }\n\n getWithResponse(\n merchantCode: string,\n memberId: string,\n options?: RequestOptions,\n ): Promise<WithResponse<Member>> {\n return this._client.getWithResponse<Member>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n ...options,\n });\n }\n\n /**\n * Update the merchant member.\n */\n update(\n merchantCode: string,\n memberId: string,\n body: UpdateMerchantMemberParams,\n options?: RequestOptions,\n ): Promise<Member> {\n return this._client.put<Member>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n body,\n ...options,\n });\n }\n\n updateWithResponse(\n merchantCode: string,\n memberId: string,\n body: UpdateMerchantMemberParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Member>> {\n return this._client.putWithResponse<Member>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n body,\n ...options,\n });\n }\n\n /**\n * Deletes a merchant member.\n */\n delete(\n merchantCode: string,\n memberId: string,\n options?: RequestOptions,\n ): Promise<void> {\n return this._client.delete<void>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n ...options,\n });\n }\n\n deleteWithResponse(\n merchantCode: string,\n memberId: string,\n options?: RequestOptions,\n ): Promise<WithResponse<void>> {\n return this._client.deleteWithResponse<void>({\n path: `/v0.1/merchants/${merchantCode}/members/${memberId}`,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type { Membership, MembershipStatus, ResourceType } from \"../../types\";\nexport type ListMembershipsQueryParams = {\n offset?: number;\n limit?: number;\n kind?: ResourceType;\n status?: MembershipStatus;\n \"resource.type\"?: ResourceType;\n \"resource.attributes.sandbox\"?: boolean;\n \"resource.name\"?: string;\n \"resource.parent.id\"?: string | null;\n \"resource.parent.type\"?: ResourceType | null;\n roles?: string[];\n};\n\nexport type ListMembershipsResponse = {\n items: Membership[];\n total_count: number;\n};\n\n/**\n * API resource for the Memberships endpoints.\n *\n * Endpoints to manage user's memberships. Memberships are used to connect the user to merchant accounts and to grant them access to the merchant's resources via roles.\n */\nexport class Memberships extends APIResource {\n /**\n * List memberships of the current user.\n */\n list(\n query?: ListMembershipsQueryParams,\n options?: RequestOptions,\n ): Promise<ListMembershipsResponse> {\n return this._client.get<ListMembershipsResponse>({\n path: `/v0.1/memberships`,\n query,\n ...options,\n });\n }\n\n listWithResponse(\n query?: ListMembershipsQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<ListMembershipsResponse>> {\n return this._client.getWithResponse<ListMembershipsResponse>({\n path: `/v0.1/memberships`,\n query,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type { ListPersonsResponseBody, Merchant, Person } from \"../../types\";\nexport type GetMerchantQueryParams = {\n version?: string;\n};\n\nexport type ListPersonsQueryParams = {\n version?: string;\n};\n\nexport type GetPersonQueryParams = {\n version?: string;\n};\n\n/**\n * API resource for the Merchants endpoints.\n *\n * Merchant account represents a single business entity at SumUp.\n */\nexport class Merchants extends APIResource {\n /**\n * Retrieve a merchant.\n */\n get(\n merchantCode: string,\n query?: GetMerchantQueryParams,\n options?: RequestOptions,\n ): Promise<Merchant> {\n return this._client.get<Merchant>({\n path: `/v1/merchants/${merchantCode}`,\n query,\n ...options,\n });\n }\n\n getWithResponse(\n merchantCode: string,\n query?: GetMerchantQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Merchant>> {\n return this._client.getWithResponse<Merchant>({\n path: `/v1/merchants/${merchantCode}`,\n query,\n ...options,\n });\n }\n\n /**\n * Returns a list of persons related to the merchant.\n */\n listPersons(\n merchantCode: string,\n query?: ListPersonsQueryParams,\n options?: RequestOptions,\n ): Promise<ListPersonsResponseBody> {\n return this._client.get<ListPersonsResponseBody>({\n path: `/v1/merchants/${merchantCode}/persons`,\n query,\n ...options,\n });\n }\n\n listPersonsWithResponse(\n merchantCode: string,\n query?: ListPersonsQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<ListPersonsResponseBody>> {\n return this._client.getWithResponse<ListPersonsResponseBody>({\n path: `/v1/merchants/${merchantCode}/persons`,\n query,\n ...options,\n });\n }\n\n /**\n * Returns a single person related to the merchant.\n */\n getPerson(\n merchantCode: string,\n personId: string,\n query?: GetPersonQueryParams,\n options?: RequestOptions,\n ): Promise<Person> {\n return this._client.get<Person>({\n path: `/v1/merchants/${merchantCode}/persons/${personId}`,\n query,\n ...options,\n });\n }\n\n getPersonWithResponse(\n merchantCode: string,\n personId: string,\n query?: GetPersonQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Person>> {\n return this._client.getWithResponse<Person>({\n path: `/v1/merchants/${merchantCode}/persons/${personId}`,\n query,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type { ErrorExtended, FinancialPayouts } from \"../../types\";\nexport type ListPayoutsV1QueryParams = {\n start_date: string;\n end_date: string;\n format?: \"json\" | \"csv\";\n limit?: number;\n order?: \"asc\" | \"desc\";\n};\n\nexport type ListPayoutsV1Error = ErrorExtended[];\n\n/**\n * API resource for the Payouts endpoints.\n *\n * The Payouts model will allow you to track funds you’ve received from SumUp.\n *\n * You can receive a detailed payouts list with information like dates, fees, references and statuses, using the `List payouts` endpoint.\n */\nexport class Payouts extends APIResource {\n /**\n * Lists payout and payout-deduction records for the specified merchant account within the requested date range.\n *\n * The response can include:\n * - regular payouts (`type = PAYOUT`)\n * - deduction records for refunds, chargebacks, direct debit returns, or balance adjustments\n *\n * Results are sorted by payout date in the requested `order`.\n */\n list(\n merchantCode: string,\n query: ListPayoutsV1QueryParams,\n options?: RequestOptions,\n ): Promise<FinancialPayouts> {\n return this._client.get<FinancialPayouts>({\n path: `/v1.0/merchants/${merchantCode}/payouts`,\n query,\n ...options,\n });\n }\n\n listWithResponse(\n merchantCode: string,\n query: ListPayoutsV1QueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<FinancialPayouts>> {\n return this._client.getWithResponse<FinancialPayouts>({\n path: `/v1.0/merchants/${merchantCode}/payouts`,\n query,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type {\n CreateReaderCheckoutRequest,\n CreateReaderCheckoutResponse,\n Metadata,\n Reader,\n ReaderID,\n ReaderName,\n ReaderPairingCode,\n StatusResponse,\n} from \"../../types\";\nexport type ListReadersResponse = { items: Reader[] };\n\nexport type CreateReaderParams = {\n pairing_code: ReaderPairingCode;\n name: ReaderName;\n metadata?: Metadata;\n};\n\nexport type UpdateReaderParams = { name?: ReaderName; metadata?: Metadata };\n\nexport type CreateReaderTerminateParams = Record<string, unknown>;\n\n/**\n * API resource for the Readers endpoints.\n *\n * A reader represents a device that accepts payments. You can use the SumUp Solo to accept in-person payments.\n */\nexport class Readers extends APIResource {\n /**\n * List all readers of the merchant.\n */\n list(\n merchantCode: string,\n options?: RequestOptions,\n ): Promise<ListReadersResponse> {\n return this._client.get<ListReadersResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers`,\n ...options,\n });\n }\n\n listWithResponse(\n merchantCode: string,\n options?: RequestOptions,\n ): Promise<WithResponse<ListReadersResponse>> {\n return this._client.getWithResponse<ListReadersResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers`,\n ...options,\n });\n }\n\n /**\n * Create a new Reader for the merchant account.\n */\n create(\n merchantCode: string,\n body: CreateReaderParams,\n options?: RequestOptions,\n ): Promise<Reader> {\n return this._client.post<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers`,\n body,\n ...options,\n });\n }\n\n createWithResponse(\n merchantCode: string,\n body: CreateReaderParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Reader>> {\n return this._client.postWithResponse<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers`,\n body,\n ...options,\n });\n }\n\n /**\n * Retrieve a Reader.\n */\n get(\n merchantCode: string,\n id: ReaderID,\n options?: RequestOptions,\n ): Promise<Reader> {\n return this._client.get<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n ...options,\n });\n }\n\n getWithResponse(\n merchantCode: string,\n id: ReaderID,\n options?: RequestOptions,\n ): Promise<WithResponse<Reader>> {\n return this._client.getWithResponse<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n ...options,\n });\n }\n\n /**\n * Delete a reader.\n */\n delete(\n merchantCode: string,\n id: ReaderID,\n options?: RequestOptions,\n ): Promise<void> {\n return this._client.delete<void>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n ...options,\n });\n }\n\n deleteWithResponse(\n merchantCode: string,\n id: ReaderID,\n options?: RequestOptions,\n ): Promise<WithResponse<void>> {\n return this._client.deleteWithResponse<void>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n ...options,\n });\n }\n\n /**\n * Update a Reader.\n */\n update(\n merchantCode: string,\n id: ReaderID,\n body: UpdateReaderParams,\n options?: RequestOptions,\n ): Promise<Reader> {\n return this._client.patch<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n body,\n ...options,\n });\n }\n\n updateWithResponse(\n merchantCode: string,\n id: ReaderID,\n body: UpdateReaderParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Reader>> {\n return this._client.patchWithResponse<Reader>({\n path: `/v0.1/merchants/${merchantCode}/readers/${id}`,\n body,\n ...options,\n });\n }\n\n /**\n * Creates a Checkout for a Reader.\n *\n * This process is asynchronous and the actual transaction may take some time to be started on the device.\n *\n *\n * There are some caveats when using this endpoint:\n * * The target device must be online, otherwise checkout won't be accepted\n * * After the checkout is accepted, the system has 60 seconds to start the payment on the target device. During this time, any other checkout for the same device will be rejected.\n *\n *\n * **Note**: If the target device is a Solo, it must be in version 3.3.24.3 or higher.\n *\n */\n createCheckout(\n merchantCode: string,\n readerId: string,\n body: CreateReaderCheckoutRequest,\n options?: RequestOptions,\n ): Promise<CreateReaderCheckoutResponse> {\n return this._client.post<CreateReaderCheckoutResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/checkout`,\n body,\n ...options,\n });\n }\n\n createCheckoutWithResponse(\n merchantCode: string,\n readerId: string,\n body: CreateReaderCheckoutRequest,\n options?: RequestOptions,\n ): Promise<WithResponse<CreateReaderCheckoutResponse>> {\n return this._client.postWithResponse<CreateReaderCheckoutResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/checkout`,\n body,\n ...options,\n });\n }\n\n /**\n * Provides the last known status for a Reader.\n *\n * This endpoint allows you to retrieve updates from the connected card reader, including the current screen being displayed during the payment process and the device status (battery level, connectivity, and update state).\n *\n * Supported States\n *\n * * `IDLE` – Reader ready for next transaction\n * * `SELECTING_TIP` – Waiting for tip input\n * * `WAITING_FOR_CARD` – Awaiting card insert/tap\n * * `WAITING_FOR_PIN` – Waiting for PIN entry\n * * `WAITING_FOR_SIGNATURE` – Waiting for customer signature\n * * `UPDATING_FIRMWARE` – Firmware update in progress\n *\n * Device Status\n *\n * * `ONLINE` – Device connected and operational\n * * `OFFLINE` – Device disconnected (last state persisted)\n *\n * **Note**: If the target device is a Solo, it must be in version 3.3.39.0 or higher.\n *\n */\n getStatus(\n merchantCode: string,\n readerId: string,\n options?: RequestOptions,\n ): Promise<StatusResponse> {\n return this._client.get<StatusResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/status`,\n ...options,\n });\n }\n\n getStatusWithResponse(\n merchantCode: string,\n readerId: string,\n options?: RequestOptions,\n ): Promise<WithResponse<StatusResponse>> {\n return this._client.getWithResponse<StatusResponse>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/status`,\n ...options,\n });\n }\n\n /**\n * Terminate a Reader Checkout stops the current transaction on the target device.\n *\n * This process is asynchronous and the actual termination may take some time to be performed on the device.\n *\n *\n * There are some caveats when using this endpoint:\n * * The target device must be online, otherwise terminate won't be accepted\n * * The action will succeed only if the device is waiting for cardholder action: e.g: waiting for card, waiting for PIN, etc.\n * * There is no confirmation of the termination.\n *\n * If a transaction is successfully terminated and `return_url` was provided on Checkout, the transaction status will be sent as `failed` to the provided URL.\n *\n *\n * **Note**: If the target device is a Solo, it must be in version 3.3.28.0 or higher.\n *\n */\n terminateCheckout(\n merchantCode: string,\n readerId: string,\n body?: CreateReaderTerminateParams,\n options?: RequestOptions,\n ): Promise<void> {\n return this._client.post<void>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/terminate`,\n body,\n ...options,\n });\n }\n\n terminateCheckoutWithResponse(\n merchantCode: string,\n readerId: string,\n body?: CreateReaderTerminateParams,\n options?: RequestOptions,\n ): Promise<WithResponse<void>> {\n return this._client.postWithResponse<void>({\n path: `/v0.1/merchants/${merchantCode}/readers/${readerId}/terminate`,\n body,\n ...options,\n });\n }\n}\n","// Code generated by @sumup/sumup-ts-codegen. DO NOT EDIT.\n\nimport {\n APIResource,\n type RequestOptions,\n type WithResponse,\n} from \"../../core\";\nimport type { Receipt } from \"../../types\";\nexport type GetReceiptQueryParams = {\n mid: string;\n tx_event_id?: number;\n};\n\n/**\n * API resource for the Receipts endpoints.\n *\n * The Receipts model obtains receipt-like details for specific transactions.\n */\nexport class Receipts extends APIResource {\n /**\n * Retrieves receipt specific data for a transaction.\n */\n get(\n id: string,\n query: GetReceiptQueryParams,\n options?: RequestOptions,\n ): Promise<Receipt> {\n return this._client.get<Receipt>({\n path: `/v1.1/receipts/${id}`,\n query,\n ...options,\n });\n }\n\n getWithResponse(\n id: string,\n query: GetReceiptQueryParams,\n options?: RequestOptions,\n ): Promise<WithResponse<Receipt>> {\n return this._client.getWithResponse<Receipt>({\n path: `/v1.1/receipts/${id}`,\n query,\n ...options,\n });\n