ER diagram for Refunds
Overview
This document explains about the ER diagram for refunds which includes the following tables:
-
CC_REFUND:The CC_REFUND table stores comprehensive records of refund transactions initiated within the payment system. Each entry captures the lifecycle of a refund request, including its origin, processing status, associated payment details, and vendor-specific metadata. It serves as a central repository for tracking and managing refund operations across multiple payment platforms and merchant integrations.
-
CC_REFUND_GROUP:The CC_REFUND_GROUP table serves as a logical grouping mechanism for multiple related refund transactions. This table is ideal for managing multi-part refunds, especially in systems that support split payments, batch processing, or merchant-level reconciliation
The following tables contain fields with their respective description.
CC_REFUND
The CC_REFUND table stores comprehensive records of refund transactions initiated within the payment system. Each entry captures the lifecycle of a refund request, including its origin, processing status, associated payment details, and vendor-specific metadata. It serves as a central repository for tracking and managing refund operations across multiple payment platforms and merchant integrations.
| Field | Description |
|---|---|
| Id | Unique identifier for the refund record. |
| Payment_id | Reference to the original payment being refunded. |
| Payment_method_id | ID of the payment method used for the original transaction. |
| Merchant_id | Identifier for the merchant initiating the refund. |
| Amount | Refund amount in minor currency units . |
| Reason | Enumerated reason for the refund. |
| Merchant_transaction_id | Merchant-side transaction reference. |
| metadata | Custom key-value pairs for storing contextual data. |
| refund_group_id | Identifier linking this refund to a parent group in the CC_REFUND_GROUP table. |
| customer_id | ID of the customer receiving the refund. |
| Vendor_payment_id | External payment reference from the vendor. |
| Created_at_ts | Timestamp indicating when the refund record was first created in the system. |
| Last_modified_ts | Timestamp of the most recent update to the refund record. |
| Vendor_refund_id | External refund reference from the vendor. |
| Vendor_merchant_id | Vendor-specific merchant identifier. |
| Vendor_merchant_customer_id | Vendor-specific customer identifier tied to the merchant. |
| Vendor_platform_customer_id | Platform-level customer identifier from the vendor. |
| Vendor_platform_payment_method_id | Platform-level payment method identifier from the vendor. |
| Status | Current status of the refund. |
| Vendor | Name of the payment vendor. |
| Error | Structured error response if the refund fails. |
| Agent | Information about the agent or system initiating the refund. |
| payment_method | Full details of the payment method used. |
CC_REFUND_GROUP
The CC_REFUND_GROUP table serves as a logical grouping mechanism for multiple related refund transactions. This table is ideal for managing multi-part refunds, especially in systems that support split payments, batch processing, or merchant-level reconciliation
| Field Name | Description |
|---|---|
| id | Primary key for the refund group. Uniquely identifies each refund group record. |
| merchant_id | Identifier for the merchant initiating the refund group. Used to associate the group with a specific merchant account. |
| merchant_transaction_id | Merchant-side reference ID for the transaction. Helps link the refund group to the merchant’s internal systems or order records. |
| payment_id | Identifier for the original payment transaction. Serves as the anchor for all refunds in this group. |
| amount | Total refund amount for the group. Represents the sum of all individual refunds within this group. |
| status | Current status of the refund group. Reflects the overall progress of grouped refunds. |
| reason | Common reason for initiating the refund group. Provides business context. |
| metadata | Flexible key-value store for additional contextual information. Useful for extensibility. |
| created_at_ts | Timestamp when the refund group was created. |
| last_modified_ts | Timestamp of the most recent update to the refund group. |
| refund_details | JSON structure containing detailed information about individual refunds in the group. |
Error subfields and description
| Field Name | Description |
|---|---|
| errorGroup | Categorizes the error into a logical group. |
| errorCode | A unique code representing the specific error type, useful for tracking/debugging. |
| message | A human-readable explanation of the error, intended for display or logging. |
| httpStatus | The HTTP status code associated with the error. |
| errorDetails | Additional structured information about the error, such as field-level issues or context. |
paymentMethod subfields and description
| Field Name | Description |
|---|---|
| id | Unique identifier for the payment method. |
| paymentMethodType | Type of payment method. |
| vendorPaymentMethodId | Identifier assigned by the vendor for this payment method. |
| customerId | ID of the customer who owns this payment method. |
| vendor | Vendor details associated with the payment method. |
| status | Current status of the payment method. |
| isDefault | Indicates if this is the default payment method for the customer. |
| zipCode | ZIP code associated with the payment method, often for billing verification. |
| error | Error details if the payment method is invalid or failed. |
| nickname | User-defined nickname for easy identification of the payment method. |
| lastModifiedBySource | Source system or actor that last modified the payment method. |
| lastModifiedByMerchantId | Merchant ID that last modified the payment method. |
| lastModifiedByAgent | Agent who last modified the payment method. |
| paymentMethodDetails | Detailed attributes of the payment method. |
| warning | Warning messages related to the payment method. Stored as json |
| deletedPaymentMethodId | ID of a previously deleted payment method, if applicable. |
| eventContext | Contextual metadata for events involving this payment method. |
| metadata | Custom key-value pairs for additional information. |
| authRequired | Indicates if authentication is required for using this payment method. |
| partialAuthorization | Allows partial authorization if full amount isn't available. |
| sourceProvider | Identifies the source system or provider of the payment method. |
| savePaymentMethod | Indicates if the payment method should be saved for future use. |
| attachRequired | Specifies if the payment method must be attached to a session or entity. |
| validate | Indicates whether the payment method should be validated before use. |
| sessionId | ID of the session associated with this payment method. |
| initialVendorPaymentMethodId | Original vendor-assigned ID before any updates or changes. |
refund_details subfields and description
| Field Name | Description |
|---|---|
| refundAllocations | A list of allocation details specifying how the refund amount was distributed. |
refundAllocations subfields and description
| Field Name | Description |
|---|---|
| id | Unique identifier for the payment allocation record. |
| paymentAllocationId | The unique identifier of the payment allocation associated with this refund. |
| paymentMethodId | The unique identifier of the payment method used for this allocation. |
| amount | The amount allocated for this specific refund allocation. |
| status | The status of the individual refund allocation. |