@sumup/sdk
Version:
The official TypeScript SDK for the SumUp API
196 lines • 4.16 kB
TypeScript
import * as Core from "../../core.js";
/**
* Unique ID of the transaction event.
*/
export type EventID = number;
/**
* Unique ID of the transaction.
*/
export type TransactionID = string;
/**
* Type of the transaction event.
*/
export type EventType = "PAYOUT" | "CHARGE_BACK" | "REFUND" | "PAYOUT_DEDUCTION";
/**
* Status of the transaction event.
*/
export type EventStatus = "PENDING" | "SCHEDULED" | "FAILED" | "REFUNDED" | "SUCCESSFUL" | "PAID_OUT";
/**
* Amount of the event.
*/
export type AmountEvent = number;
/**
* Date and time of the transaction event.
*/
export type TimestampEvent = string;
export type ReceiptCard = {
/**
* Card last 4 digits.
*/
last_4_digits?: string;
/**
* Card Scheme.
*/
type?: string;
};
export type ReceiptEvent = {
id?: EventID;
transaction_id?: TransactionID;
type?: EventType;
status?: EventStatus;
amount?: AmountEvent;
timestamp?: TimestampEvent;
receipt_no?: string;
};
/**
* Transaction information.
*/
export type ReceiptTransaction = {
/**
* Transaction code.
*/
transaction_code?: string;
/**
* Transaction amount.
*/
amount?: string;
/**
* Transaction VAT amount.
*/
vat_amount?: string;
/**
* Tip amount (included in transaction amount).
*/
tip_amount?: string;
/**
* Transaction currency.
*/
currency?: string;
/**
* Time created at.
*/
timestamp?: string;
/**
* Transaction processing status.
*/
status?: string;
/**
* Transaction type.
*/
payment_type?: string;
/**
* Transaction entry mode.
*/
entry_mode?: string;
/**
* Cardholder verification method.
*/
verification_method?: string;
card?: ReceiptCard;
/**
* Number of installments.
*/
installments_count?: number;
/**
* Products
*/
products?: {
/**
* Product name.
*/
name?: string;
/**
* Product description.
*/
description?: string;
/**
* Product price.
*/
price?: number;
/**
* Product quantity.
*/
quantity?: number;
/**
* Quantity x product price.
*/
total_price?: number;
}[];
/**
* Vat rates.
*/
vat_rates?: {
/**
* Gross
*/
gross?: number;
/**
* Net
*/
net?: number;
/**
* Rate
*/
rate?: number;
/**
* Vat
*/
vat?: number;
}[];
/**
* Events
*/
events?: ReceiptEvent[];
/**
* Receipt number
*/
receipt_no?: string;
};
/**
* Receipt merchant data
*/
export type ReceiptMerchantData = {
merchant_profile?: {
merchant_code?: string;
business_name?: string;
email?: string;
address?: {
address_line1?: string;
city?: string;
country?: string;
country_en_name?: string;
country_native_name?: string;
post_code?: string;
landline?: string;
};
};
locale?: string;
};
/**
* Receipt
*/
export type Receipt = {
transaction_data?: ReceiptTransaction;
merchant_data?: ReceiptMerchantData;
emv_data?: Record<string, unknown>;
acquirer_data?: {
tid?: string;
authorization_code?: string;
return_code?: string;
local_time?: string;
};
};
export type GetReceiptQueryParams = {
mid: string;
tx_event_id?: number;
};
export declare class Receipts extends Core.APIResource {
/**
* Retrieve receipt details
*/
get(id: string, query: GetReceiptQueryParams, params?: Core.FetchParams): Core.APIPromise<Receipt>;
}
export declare namespace Receipts {
export type { AmountEvent, EventID, EventStatus, EventType, GetReceiptQueryParams, Receipt, ReceiptCard, ReceiptEvent, ReceiptMerchantData, ReceiptTransaction, TimestampEvent, TransactionID, };
}
//# sourceMappingURL=index.d.ts.map