PaymentRecord
Type: schema
Description
A payment Commerce Engine received (a gateway payment, a NACH debit, a bank deposit, a cash or other offline payment, or a payment an admin records): the payment itself for payment.received, payment.attributed and payment.cancelled; one allocation of it, or the part of an allocation returned to the customer's credit balance, with the payment's status and amounts after it, for payment.settled and payment.settlement_reversed.
TypeScript Definition
typescript
PaymentRecord: {{
/**
* @description Always `payment` here; refunds have their own events.
* @enum {string}
*/
transaction_type?: "payment";
/** @description When the money was paid. */
transaction_date?: string;
/** @description The amount received. */
transaction_amount?: number;
/** @description Part of the payment allocated to orders, or refunded from the part no order holds (a refund in progress included), after the change. Credit returned to the customer's balance counts as unallocated again. */
settled_amount: number;
/** @description Part neither allocated to an order nor refunded; for a bank transfer, the customer's unused credit from it. Below `0` when it was refunded beyond what it had left. */
unsettled_amount: number;
/** @description The payment's number: a gateway or offline payment's request number (`{request_number}-{transaction reference}` for a second transaction charged on one payment request), a NACH debit's order number (`{order_number}-{charge reference}` for a charge held for an admin to refund), a deposit's UTR, or a number generated for a payment an admin records. */
request_number: string;
/**
* @description The payment's status after the change.
* @enum {string}
*/
status: "pending" | "unsettled" | "partially_settled" | "settled" | "cancelled";
/**
* @description `bank-transfer`: a bank deposit. `payment-gateway`: a gateway payment or NACH debit. `manual`: cash or another offline payment, marked paid at checkout or at the till, or recorded by an admin.
* @enum {string}
*/
payment_mode: "bank-transfer" | "payment-gateway" | "manual" | "";
/** @description How it was paid, e.g. `NEFT`, `UPI`, `Netbanking`, `Credit Card`; for a `manual` payment, the offline payment method it was recorded with. */
payment_method?: null | string;
/** @description The payment gateway's transaction id, or the bank's UTR. */
payment_reference_number?: null | string;
payment_gateway?: null | string;
/** @description The customer the money is attributed to; `null` for a deposit not yet attributed. */
customer_id?: null | string;
user_id?: null | string;
/** @description The payer's or customer's name. */
customer_name?: string;
icon_url?: string | null;
bank_account_number?: string | null;
bank_name?: string | null;
/** @description The virtual account a bank transfer was paid into. */
virtual_account_number?: string;
upi_id?: null | string;
/** @description The allocation; for `payment.settlement_reversed`, the allocation it gives back (the `settlement_id` its `payment.settled` carried). Settlement events only. */
settlement_id?: number;
/** @description The amount allocated, or the part of it returned (settlement events only). */
amount?: number;
/** @description The order the allocation pays (settlement events only); `null` when it pays a credit-balance refund. */
order_number?: null | string;
/** @description When the allocation was made (settlement events only). */
created_at?: string;
card_number?: string | null;
card_type?: string | null;
wallet_name?: string | null;
};
/** PayoutConfig */
}OpenAPI Schema
json
{
"title": "PaymentRecord",
"description": "A payment Commerce Engine received (a gateway payment, a NACH debit, a bank deposit, a cash or other offline payment, or a payment an admin records): the payment itself for `payment.received`, `payment.attributed` and `payment.cancelled`; one allocation of it, or the part of an allocation returned to the customer's credit balance, with the payment's status and amounts after it, for `payment.settled` and `payment.settlement_reversed`.",
"type": "object",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/schemas/PaymentRecord",
"description": "API reference for the PaymentRecord schema"
},
"required": [
"payment_mode",
"request_number",
"settled_amount",
"status",
"unsettled_amount"
],
"properties": {
"transaction_type": {
"description": "Always `payment` here; refunds have their own events.",
"type": "string",
"enum": [
"payment"
]
},
"transaction_date": {
"description": "When the money was paid.",
"type": "string"
},
"transaction_amount": {
"description": "The amount received.",
"type": "number"
},
"settled_amount": {
"description": "Part of the payment allocated to orders, or refunded from the part no order holds (a refund in progress included), after the change. Credit returned to the customer's balance counts as unallocated again.",
"type": "number"
},
"unsettled_amount": {
"description": "Part neither allocated to an order nor refunded; for a bank transfer, the customer's unused credit from it. Below `0` when it was refunded beyond what it had left.",
"type": "number"
},
"request_number": {
"description": "The payment's number: a gateway or offline payment's request number (`{request_number}-{transaction reference}` for a second transaction charged on one payment request), a NACH debit's order number (`{order_number}-{charge reference}` for a charge held for an admin to refund), a deposit's UTR, or a number generated for a payment an admin records.",
"type": "string"
},
"status": {
"description": "The payment's status after the change.",
"type": "string",
"enum": [
"pending",
"unsettled",
"partially_settled",
"settled",
"cancelled"
]
},
"payment_mode": {
"description": "`bank-transfer`: a bank deposit. `payment-gateway`: a gateway payment or NACH debit. `manual`: cash or another offline payment, marked paid at checkout or at the till, or recorded by an admin.",
"type": "string",
"enum": [
"bank-transfer",
"payment-gateway",
"manual",
""
]
},
"payment_method": {
"description": "How it was paid, e.g. `NEFT`, `UPI`, `Netbanking`, `Credit Card`; for a `manual` payment, the offline payment method it was recorded with.",
"type": [
"null",
"string"
]
},
"payment_reference_number": {
"description": "The payment gateway's transaction id, or the bank's UTR.",
"type": [
"null",
"string"
]
},
"payment_gateway": {
"type": [
"null",
"string"
]
},
"customer_id": {
"description": "The customer the money is attributed to; `null` for a deposit not yet attributed.",
"type": [
"null",
"string"
]
},
"user_id": {
"type": [
"null",
"string"
]
},
"customer_name": {
"description": "The payer's or customer's name.",
"type": "string"
},
"icon_url": {
"type": [
"string",
"null"
]
},
"bank_account_number": {
"type": [
"string",
"null"
]
},
"bank_name": {
"type": [
"string",
"null"
]
},
"virtual_account_number": {
"description": "The virtual account a bank transfer was paid into.",
"type": "string"
},
"upi_id": {
"type": [
"null",
"string"
]
},
"settlement_id": {
"description": "The allocation; for `payment.settlement_reversed`, the allocation it gives back (the `settlement_id` its `payment.settled` carried). Settlement events only.",
"type": "integer"
},
"amount": {
"description": "The amount allocated, or the part of it returned (settlement events only).",
"type": "number"
},
"order_number": {
"description": "The order the allocation pays (settlement events only); `null` when it pays a credit-balance refund.",
"type": [
"null",
"string"
]
},
"created_at": {
"description": "When the allocation was made (settlement events only).",
"type": "string"
},
"card_number": {
"type": [
"string",
"null"
]
},
"card_type": {
"type": [
"string",
"null"
]
},
"wallet_name": {
"type": [
"string",
"null"
]
}
}
}Auto-generated from OpenAPI spec and TypeScript definitions