Skip to main content
Version: v2

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.

FieldDescription
IdUnique identifier for the refund record.
Payment_idReference to the original payment being refunded.
Payment_method_idID of the payment method used for the original transaction.
Merchant_idIdentifier for the merchant initiating the refund.
AmountRefund amount in minor currency units .
ReasonEnumerated reason for the refund.
Merchant_transaction_idMerchant-side transaction reference.
metadataCustom key-value pairs for storing contextual data.
refund_group_idIdentifier linking this refund to a parent group in the CC_REFUND_GROUP table.
customer_idID of the customer receiving the refund.
Vendor_payment_idExternal payment reference from the vendor.
Created_at_tsTimestamp indicating when the refund record was first created in the system.
Last_modified_tsTimestamp of the most recent update to the refund record.
Vendor_refund_idExternal refund reference from the vendor.
Vendor_merchant_idVendor-specific merchant identifier.
Vendor_merchant_customer_idVendor-specific customer identifier tied to the merchant.
Vendor_platform_customer_idPlatform-level customer identifier from the vendor.
Vendor_platform_payment_method_idPlatform-level payment method identifier from the vendor.
StatusCurrent status of the refund.
VendorName of the payment vendor.
ErrorStructured error response if the refund fails.
AgentInformation about the agent or system initiating the refund.
payment_methodFull 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 NameDescription
idPrimary key for the refund group. Uniquely identifies each refund group record.
merchant_idIdentifier for the merchant initiating the refund group. Used to associate the group with a specific merchant account.
merchant_transaction_idMerchant-side reference ID for the transaction. Helps link the refund group to the merchant’s internal systems or order records.
payment_idIdentifier for the original payment transaction. Serves as the anchor for all refunds in this group.
amountTotal refund amount for the group. Represents the sum of all individual refunds within this group.
statusCurrent status of the refund group. Reflects the overall progress of grouped refunds.
reasonCommon reason for initiating the refund group. Provides business context.
metadataFlexible key-value store for additional contextual information. Useful for extensibility.
created_at_tsTimestamp when the refund group was created.
last_modified_tsTimestamp of the most recent update to the refund group.
refund_detailsJSON structure containing detailed information about individual refunds in the group.

Error subfields and description

Field NameDescription
errorGroupCategorizes the error into a logical group.
errorCodeA unique code representing the specific error type, useful for tracking/debugging.
messageA human-readable explanation of the error, intended for display or logging.
httpStatusThe HTTP status code associated with the error.
errorDetailsAdditional structured information about the error, such as field-level issues or context.

paymentMethod subfields and description

Field NameDescription
idUnique identifier for the payment method.
paymentMethodTypeType of payment method.
vendorPaymentMethodIdIdentifier assigned by the vendor for this payment method.
customerIdID of the customer who owns this payment method.
vendorVendor details associated with the payment method.
statusCurrent status of the payment method.
isDefaultIndicates if this is the default payment method for the customer.
zipCodeZIP code associated with the payment method, often for billing verification.
errorError details if the payment method is invalid or failed.
nicknameUser-defined nickname for easy identification of the payment method.
lastModifiedBySourceSource system or actor that last modified the payment method.
lastModifiedByMerchantIdMerchant ID that last modified the payment method.
lastModifiedByAgentAgent who last modified the payment method.
paymentMethodDetailsDetailed attributes of the payment method.
warningWarning messages related to the payment method. Stored as json
deletedPaymentMethodIdID of a previously deleted payment method, if applicable.
eventContextContextual metadata for events involving this payment method.
metadataCustom key-value pairs for additional information.
authRequiredIndicates if authentication is required for using this payment method.
partialAuthorizationAllows partial authorization if full amount isn't available.
sourceProviderIdentifies the source system or provider of the payment method.
savePaymentMethodIndicates if the payment method should be saved for future use.
attachRequiredSpecifies if the payment method must be attached to a session or entity.
validateIndicates whether the payment method should be validated before use.
sessionIdID of the session associated with this payment method.
initialVendorPaymentMethodIdOriginal vendor-assigned ID before any updates or changes.

refund_details subfields and description

Field NameDescription
refundAllocationsA list of allocation details specifying how the refund amount was distributed.

refundAllocations subfields and description

Field NameDescription
idUnique identifier for the payment allocation record.
paymentAllocationIdThe unique identifier of the payment allocation associated with this refund.
paymentMethodIdThe unique identifier of the payment method used for this allocation.
amountThe amount allocated for this specific refund allocation.
statusThe status of the individual refund allocation.