API Version
Product Catalog
Library
This resource represents the transaction event that has happened in your account.

Sample transaction [ JSON ]

{ "amount": 1000, "amount_capturable": 1000, "authorization_reason": "blocking_funds", "base_currency_code": "USD", "currency_code": "USD", "customer_id": "__test__KyVnHhSBWltgF2p6", "date": 1600968316, "deleted": false, "exchange_rate": 1, "fraud_reason": "Payment complete.", "gateway": "stripe", "gateway_account_id": "gw___test__KyVnGlSBWltbL2AB", "id": "txn___test__KyVnHhSBWltv42pB", "id_at_gateway": "ch_1HUyC0Jv9j0DyntJiR6W37yv", "linked_payments": [], "masked_card_number": "************1111", "object": "transaction", "payment_method": "card", "payment_source_id": "pm___test__KyVnHhSBWltu42p7", "resource_version": 1517505917000, "status": "success", "type": "authorization", "updated_at": 1517505917 }

API Index URL GET

https://{site}.chargebee.com/api/v2/transactions

Model Class

id
string, max chars=40
Uniquely identifies the transaction.
customer_id
optional, string, max chars=50
Identifier of the customer for which this transaction is made
subscription_id
optional, string, max chars=50
Identifier of the subscription for which this transaction is made.
gateway_account_id
optional, string, max chars=50
The gateway account used for this transaction
payment_source_id
optional, string, max chars=40
Identifier of the payment source for which this transaction is made
payment_method
enumerated string, default=card
The payment method of this transaction
Possible values are
cardCardcashCashcheckCheckchargebackOnly applicable for a transaction of type = refund. This value is set by Chargebee when an automated chargeback occurs. You can also set this explicitly when recording a refund.
Show all values[+]
reference_number
optional, string, max chars=100
The reference number for this transaction. For example, the check number when payment_method = check.
gateway
enumerated string
Gateway through which this transaction was done. Applicable only for 'Card' Payment Method
Possible values are
chargebeeChargebee test gateway.chargebee_paymentsChargebee Payments gatewayadyenAdyen is a payment gateway.stripeStripe is a payment gateway.
Show all values[+]
type
enumerated string
Type of the transaction.
Possible values are
authorizationThe transaction represents an authorization for capturing the amount from the customer’s payment_source.paymentThe transaction represents capture of amount from the customer’s payment_source.refundThe transaction represents a refund of amount to the customer’s payment_source.payment_reversalIndicates a reversal transaction.
Show all values[+]
date
optional, timestamp(UTC) in seconds
Indicates when this transaction occurred.
settled_at
optional, timestamp(UTC) in seconds
Indicates the time at which the final status of the transaction has been marked.
exchange_rate
optional, bigdecimal, min=1E-9, max=999999999.999999999
Exchange rate used for base currency conversion
currency_code
string, max chars=3
The currency code (ISO 4217 format) for the transaction.
amount
optional, in cents, min=0
Amount for this transaction.
id_at_gateway
optional, string, max chars=100
The id with which this transaction is referred in gateway.
status
optional, enumerated string
The status of this transaction.
Possible values are
in_progressTransaction is being processed by the gateway. This typically happens for direct debit transactions or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method.successThe transaction is successful.voidedThe transaction got voided or authorization expired at gateway.failureTransaction failed. Refer the 'error_code' and 'error_text' fields to know the reason for failure
Show all values[+]
fraud_flag
optional, enumerated string
Indicates whether or not the transaction has been identified as fraudulent.
Possible values are
safeThe transaction has been marked as safesuspiciousThe transaction has been identified as potentially fraudulent by the gatewayfraudulentThe transaction has been marked as fraudulent
Show all values[+]
initiator_type
optional, enumerated string
Marker for on-session payments (3DS). null indicates ‘merchant’.
Possible values are
customerCustomer initiated 3DS paymentmerchantPayment initiated on stored payment method by the merchant
Show all values[+]
three_d_secure
optional, boolean
Indicates whether this transaction has gone through 3DS. Applicable only for ‘on-session’ payments & verifications.If 3DS is not enforced by the gateway/bank or if the customers’ card is not enrolled, this will be false.
authorization_reason
optional, enumerated string
Type of authorization transaction.
Possible values are
blocking_fundsThe transaction has been created to block the funds from payment method.verificationThe transaction has been created for payment method verification.
Show all values[+]
error_code
optional, string, max chars=100
Error code received from the payment gateway on failure.
error_text
optional, string, max chars=65k
Error message received from the payment gateway on failure.
voided_at
optional, timestamp(UTC) in seconds
Timestamp indicating when the payment was voided or authorization expired at gateway.
resource_version
optional, long
Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this transaction was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
fraud_reason
optional, string, max chars=250
Short description why the transaction was marked as fraud/suspicious
custom_payment_method_id
optional, string, max chars=50
Identifier of the custom payment method of this transaction.
amount_unused
optional, in cents, min=0
This is the part of the amount which has not been invoiced yet and is therefore added to excess_payments for the customer. Applicable only for a transaction of type = payment.
masked_card_number
optional, string, max chars=20
The masked card number used for this transaction. Applicable only for 'Card' Payment Method
reference_transaction_id
optional, string, max chars=40
This is the id of the offline transaction that is being refunded or reversed. Applicable only for transaction of type = refund or payment_reversal.
refunded_txn_id
optional, string, max chars=40
This is the id of the transaction (always of type = payment) being refunded. Applicable only for transaction of type = refund.
reference_authorization_id
optional, string, max chars=40
This is the id of the transaction (always of type = authorization) which authorizes the payment being captured. Applicable only for transaction of type = payment.
amount_capturable
optional, in cents, min=0
This is the part of the authorized amount that is yet to be captured. The payment capture is recorded as a transaction of of type = payment. Applicable only for a transaction of type = authorization.
reversal_transaction_id
optional, string, max chars=40
Reversal transaction id. Applicable only for payment transactions.
deleted
boolean
Indicates that this resource has been deleted.
iin
optional, string, min chars=4, max chars=6
First 6 digits of the card payment method.
last4
optional, string, min chars=4, max chars=4
Last 4 digits of the card payment method.
merchant_reference_id
optional, string, max chars=500
A unique id used to track this transaction across various systems you integrate with. This id is passed to the payment gateway when the transaction is initiated. Supported only for the Exact payment gateway.
business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this transaction. This is always the same as the business entity of the customer.

payment_method_details
optional, string
Payment method details of the corresponding transaction
custom_payment_method_name
optional, string, max chars=100
Name of the custom payment method of this transaction.
linked_invoices
Show attributes [+]
optional, list of invoice_transaction
Applicable only for 'Payment' transactions. The list of invoices this 'payment' transaction is applied to.
linked_credit_notes
Show attributes [+]
optional, list of credit_note_transaction
Applicable only for 'Refund' transactions. The list of Credit Notes this 'refund' transaction is associated with.
linked_refunds
Show attributes [+]
optional, list of txn_refunds_and_reversal
Applicable only for Payment transactions. It only returns values when the transaction is not associated with an invoice, and that there is a refund for the transaction.
linked_payments
Show attributes [+]
optional, list of linked_payment
The list of payments captured for this authorization transaction.
error_detail
Show attributes [+]
optional, gateway_error_detail
Comprehensive information regarding the error experienced during an unsuccessful or declined transaction. Learn more about gateway error references
id id
string, max chars=40
Uniquely identifies the transaction.
customer_id customer_id
optional, string, max chars=50
Identifier of the customer for which this transaction is made
subscription_id subscription_id
optional, string, max chars=50
Identifier of the subscription for which this transaction is made.
gateway_account_id gateway_account_id
optional, string, max chars=50
The gateway account used for this transaction
payment_source_id payment_source_id
optional, string, max chars=40
Identifier of the payment source for which this transaction is made
payment_method payment_method
enumerated string, default=card
The payment method of this transaction
Possible values are
cardCardcashCashcheckCheckchargebackOnly applicable for a transaction of type = refund. This value is set by Chargebee when an automated chargeback occurs. You can also set this explicitly when recording a refund.
Show all values[+]
reference_number reference_number
optional, string, max chars=100
The reference number for this transaction. For example, the check number when payment_method = check.
gateway gateway
enumerated string
Gateway through which this transaction was done. Applicable only for 'Card' Payment Method
Possible values are
chargebeeChargebee test gateway.chargebee_paymentsChargebee Payments gatewayadyenAdyen is a payment gateway.stripeStripe is a payment gateway.
Show all values[+]
type type
enumerated string
Type of the transaction.
Possible values are
authorizationThe transaction represents an authorization for capturing the amount from the customer’s payment_source.paymentThe transaction represents capture of amount from the customer’s payment_source.refundThe transaction represents a refund of amount to the customer’s payment_source.payment_reversalIndicates a reversal transaction.
Show all values[+]
date date
optional, timestamp(UTC) in seconds
Indicates when this transaction occurred.
settled_at settled_at
optional, timestamp(UTC) in seconds
Indicates the time at which the final status of the transaction has been marked.
exchange_rate exchange_rate
optional, bigdecimal, min=1E-9, max=999999999.999999999
Exchange rate used for base currency conversion
currency_code currency_code
string, max chars=3
The currency code (ISO 4217 format) for the transaction.
amount amount
optional, in cents, min=0
Amount for this transaction.
id_at_gateway id_at_gateway
optional, string, max chars=100
The id with which this transaction is referred in gateway.
status status
optional, enumerated string
The status of this transaction.
Possible values are
in_progressTransaction is being processed by the gateway. This typically happens for direct debit transactions or, in case of cards, refund transactions. Such transactions can take 2-7 days to complete, depending on the gateway and payment method.successThe transaction is successful.voidedThe transaction got voided or authorization expired at gateway.failureTransaction failed. Refer the 'error_code' and 'error_text' fields to know the reason for failure
Show all values[+]
fraud_flag fraud_flag
optional, enumerated string
Indicates whether or not the transaction has been identified as fraudulent.
Possible values are
safeThe transaction has been marked as safesuspiciousThe transaction has been identified as potentially fraudulent by the gatewayfraudulentThe transaction has been marked as fraudulent
Show all values[+]
initiator_type initiator_type
optional, enumerated string
Marker for on-session payments (3DS). null indicates ‘merchant’.
Possible values are
customerCustomer initiated 3DS paymentmerchantPayment initiated on stored payment method by the merchant
Show all values[+]
three_d_secure three_d_secure
optional, boolean
Indicates whether this transaction has gone through 3DS. Applicable only for ‘on-session’ payments & verifications.If 3DS is not enforced by the gateway/bank or if the customers’ card is not enrolled, this will be false.
authorization_reason authorization_reason
optional, enumerated string
Type of authorization transaction.
Possible values are
blocking_fundsThe transaction has been created to block the funds from payment method.verificationThe transaction has been created for payment method verification.
Show all values[+]
error_code error_code
optional, string, max chars=100
Error code received from the payment gateway on failure.
error_text error_text
optional, string, max chars=65k
Error message received from the payment gateway on failure.
voided_at voided_at
optional, timestamp(UTC) in seconds
Timestamp indicating when the payment was voided or authorization expired at gateway.
resource_version resource_version
optional, long
Version number of this resource. The resource_version is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
updated_at updated_at
optional, timestamp(UTC) in seconds
Timestamp indicating when this transaction was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
fraud_reason fraud_reason
optional, string, max chars=250
Short description why the transaction was marked as fraud/suspicious
custom_payment_method_id custom_payment_method_id
optional, string, max chars=50
Identifier of the custom payment method of this transaction.
amount_unused amount_unused
optional, in cents, min=0
This is the part of the amount which has not been invoiced yet and is therefore added to excess_payments for the customer. Applicable only for a transaction of type = payment.
masked_card_number masked_card_number
optional, string, max chars=20
The masked card number used for this transaction. Applicable only for 'Card' Payment Method
reference_transaction_id reference_transaction_id
optional, string, max chars=40
This is the id of the offline transaction that is being refunded or reversed. Applicable only for transaction of type = refund or payment_reversal.
refunded_txn_id refunded_txn_id
optional, string, max chars=40
This is the id of the transaction (always of type = payment) being refunded. Applicable only for transaction of type = refund.
reference_authorization_id reference_authorization_id
optional, string, max chars=40
This is the id of the transaction (always of type = authorization) which authorizes the payment being captured. Applicable only for transaction of type = payment.
amount_capturable amount_capturable
optional, in cents, min=0
This is the part of the authorized amount that is yet to be captured. The payment capture is recorded as a transaction of of type = payment. Applicable only for a transaction of type = authorization.
reversal_transaction_id reversal_transaction_id
optional, string, max chars=40
Reversal transaction id. Applicable only for payment transactions.
deleted deleted
boolean
Indicates that this resource has been deleted.
iin iin
optional, string, min chars=4, max chars=6
First 6 digits of the card payment method.
last4 last4
optional, string, min chars=4, max chars=4
Last 4 digits of the card payment method.
merchant_reference_id merchant_reference_id
optional, string, max chars=500
A unique id used to track this transaction across various systems you integrate with. This id is passed to the payment gateway when the transaction is initiated. Supported only for the Exact payment gateway.
business_entity_id business_entity_id
optional, string, max chars=50
The unique ID of the business entity of this transaction. This is always the same as the business entity of the customer.

payment_method_details payment_method_details
optional, string
Payment method details of the corresponding transaction
custom_payment_method_name custom_payment_method_name
optional, string, max chars=100
Name of the custom payment method of this transaction.
linked_invoices
optional, list of invoice_transaction
Applicable only for 'Payment' transactions. The list of invoices this 'payment' transaction is applied to.
linked_credit_notes
optional, list of credit_note_transaction
Applicable only for 'Refund' transactions. The list of Credit Notes this 'refund' transaction is associated with.
linked_refunds
optional, list of txn_refunds_and_reversal
Applicable only for Payment transactions. It only returns values when the transaction is not associated with an invoice, and that there is a refund for the transaction.
linked_payments
optional, list of linked_payment
The list of payments captured for this authorization transaction.
error_detail
optional, gateway_error_detail
Comprehensive information regarding the error experienced during an unsuccessful or declined transaction. Learn more about gateway error references

Authorizes a specific amount in customer's Credit card, which can be collected within a span of time. Read more on authorization and capture here.

Notes

  • Supported only for Card payments.
  • Currently supported only for Stripe.
Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/create_authorization \
     -u {site_api_key}:\
     -d customer_id="__test__KyVnHhSBWltgF2p6" \
     -d amount=1000
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 1000,
        "amount_capturable": 1000,
        "authorization_reason": "blocking_funds",
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWltgF2p6",
        "date": 1600968316,
        "deleted": false,
        "exchange_rate": 1,
        "fraud_reason": "Payment complete.",
        "gateway": "stripe",
        "gateway_account_id": "gw___test__KyVnGlSBWltbL2AB",
        "id": "txn___test__KyVnHhSBWltv42pB",
        "id_at_gateway": "ch_1HUyC0Jv9j0DyntJiR6W37yv",
        "linked_payments": [],
        "masked_card_number": "************1111",
        "object": "transaction",
        "payment_method": "card",
        "payment_source_id": "pm___test__KyVnHhSBWltu42p7",
        "resource_version": 1517505917000,
        "status": "success",
        "type": "authorization",
        "updated_at": 1517505917
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/create_authorization

Method

customer_id[]
required, string, max chars=50
Identifier of the customer.
payment_source_id[]
optional, string, max chars=40
Payment source to be used for authorizing the transaction.
currency_code[]
required if Multicurrency is enabled, string, max chars=3
The currency code (ISO 4217 format) of the transaction amount.
amount[]
required, in cents, min=1
The amount to be blocked.
transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x

This API voids the specific authorization transaction in order to release the blocked funds from the customer’s card. Voiding an already captured or voided transaction is not possible.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnHhSBWlzMQ2rA/void \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 1000,
        "amount_capturable": 0,
        "authorization_reason": "blocking_funds",
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWlzC52r5",
        "date": 1600968337,
        "deleted": false,
        "exchange_rate": 1,
        "fraud_reason": "Payment complete.",
        "gateway": "stripe",
        "gateway_account_id": "gw___test__KyVnGlSBWltbL2AB",
        "id": "txn___test__KyVnHhSBWlzMQ2rA",
        "id_at_gateway": "ch_1HUyCLJv9j0DyntJDiqqG6XL",
        "linked_payments": [],
        "masked_card_number": "************1111",
        "object": "transaction",
        "payment_method": "card",
        "payment_source_id": "pm___test__KyVnHhSBWlzLf2r6",
        "resource_version": 1517505939000,
        "status": "voided",
        "type": "authorization",
        "updated_at": 1517505939,
        "voided_at": 1600968339
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}/void

Method

transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x

Records a refund made offline. Applicable only for transactions of type = payment.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnHhSBWlwT42q7/record_refund \
     -u {site_api_key}:\
     -d date=1601054726 \
     -d amount=1000 \
     -d payment_method="CHARGEBACK" \
     -d reference_number="5266787652" \
     -d comment="payment disputed"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 1000,
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWlwHl2q0",
        "date": 1601054726,
        "deleted": false,
        "exchange_rate": 1,
        "gateway": "not_applicable",
        "id": "txn___test__KyVnHhSBWlwhi2qE",
        "linked_credit_notes": [],
        "object": "transaction",
        "payment_method": "chargeback",
        "reference_number": "5266787652",
        "reference_transaction_id": "txn___test__KyVnHhSBWlwT42q7",
        "resource_version": 1517505927000,
        "status": "success",
        "type": "refund",
        "updated_at": 1517505927
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}/record_refund

Method

amount[]
optional, in cents, min=1
The amount to be recorded as refunded. Must not exceed amount_unused. If not passed then all of amount_unused is recorded as refunded.
payment_method[]
required, enumerated string
The payment method used to make the refund.
Possible values are
cashCashcheckCheckchargebackOnly applicable for a transaction of type = refund. This value is set by Chargebee when an automated chargeback occurs. You can also set this explicitly when recording a refund.bank_transferBank Transfer
Show all values[+]
date[]
required, timestamp(UTC) in seconds
The date when the refund was made.
reference_number[]
optional, string, max chars=100
The reference number for this transaction. For example, the check number when payment_method = check.
custom_payment_method_id[]
optional, string, max chars=50
Identifier of the custom payment method of this transaction.
comment[]
optional, string, max chars=300
Remarks, if any, on the refund.
transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x

Update selected attributes of the transaction resource: status, id_at_gateway, and customer_id. Use this API for reconciliation purposes where the status of a transaction is in needs_attention that can be updated to either success or failure status.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnHhSBWlwT42q7/reconcile \
     -u {site_api_key}:\
     -d id_at_gateway="cb___test__KyVnHhSBWlv4q2pU" \
     -d customer_id="__test__KyVnHhSBWlv242pN" \
     -d status="SUCCESS"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 1395,
        "amount_unused": 0,
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWlv242pN",
        "date": 1517505921,
        "deleted": false,
        "exchange_rate": 1,
        "gateway": "chargebee",
        "gateway_account_id": "gw___test__KyVnGlSBWltEk29Z",
        "id": "txn___test__KyVnHhSBWlwT42q7",
        "id_at_gateway": "cb___test__KyVnHhSBWlv4q2pU",
        "linked_invoices": [
            {
                "applied_amount": 1395,
                "applied_at": 1517505921,
                "invoice_date": 1517505920,
                "invoice_id": "__demo_inv__3",
                "invoice_status": "paid",
                "invoice_total": 1395
            },
            {..}
        ],
        "linked_refunds": [],
        "masked_card_number": "************1111",
        "object": "transaction",
        "payment_method": "card",
        "payment_source_id": "pm___test__KyVnHhSBWlv2z2pP",
        "resource_version": 1517505921000,
        "status": "success",
        "subscription_id": "__test__KyVnHhSBWlv242pN",
        "type": "payment",
        "updated_at": 1517505921
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}/reconcile

Method

id_at_gateway[]
optional, string, max chars=100
The identifier with which this transaction is referred in gateway. The id_at_gateway can only be updated when the transaction status is in needs_attention.
Note:
  • It is mandatory to pass this parameter value for updating the transaction status from needs_attention to success. It is recommended to pass this value if available in the gateway.
  • An error occurs when the provided id_at_gateway value does not match the id_at_gateway value stored against the transaction in Chargebee.
customer_id[]
optional, string, max chars=50
Unique identifier of the customer for which this transaction is made. This is needed only when the transaction is successful but not associated with any customer.
Note:
An error occurs when the provided customer_id value does not match the customer_id value stored against the transaction in Chargebee.
status[]
optional, enumerated string
The status of this transaction. The status can only be updated when the transaction status is in needs_attention state.
Possible values are
successWhen the transaction is successful.
Note:
When the transaction is updated to success status,
  • and the invoice is associated with the transaction, the transaction amount will be applied to the invoice.
  • and no invoice is associated but the customer is associated with the transaction, customer_excess_payments will be updated.
failureWhen the transaction is in failure status.
Note:

When the transaction is updated to failure status and the invoice is associated with the transaction,

  • the invoice will be moved to the payment_due status if the dunning is configured.
  • the invoice will be moved to the not_paid status if the dunning is not configured.
Show all values[+]
transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x

Refunds an online payment. Applicable only for transactions of type = payment. You can only refund a transaction whose status is success.

Notes

  • Not supported for ach_credit, sepa_credit, cash, check, bank_transfer, other.
  • Contact support@chargebee.com to enable this endpoint.
Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnpGSCut0cY8/refund \
     -u {site_api_key}:\
     -d comment="Refunding a transaction"
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 1000,
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnpGSCuszos1",
        "date": 1517482377,
        "deleted": false,
        "exchange_rate": 1,
        "gateway": "stripe",
        "gateway_account_id": "gw___test__KyVnw0SCuszXd2I",
        "id": "txn___test__KyVnpGSCut11oF",
        "id_at_gateway": "re_1HaJDZJv9j0DyntJA2VZNft4",
        "linked_credit_notes": [],
        "masked_card_number": "************1111",
        "object": "transaction",
        "payment_method": "card",
        "payment_source_id": "pm___test__KyVnpGSCut0FD2",
        "reference_transaction_id": "txn___test__KyVnpGSCut0cY8",
        "refunded_txn_id": "txn___test__KyVnpGSCut0cY8",
        "resource_version": 1517482378000,
        "status": "success",
        "type": "refund",
        "updated_at": 1517482378
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}/refund

Method

amount[]
optional, in cents, min=1
The amount to be refunded. Must not exceed amount_unused. If not passed then all of amount_unused is refunded.
comment[]
optional, string, max chars=300
Remarks, if any, on the refund.
transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x
Lists all the transactions.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=2 \
     --data-urlencode "status[is]"="success" \
     --data-urlencode "sort_by[asc]"=date
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "transaction": {
                "amount": 1395,
                "amount_unused": 0,
                "base_currency_code": "USD",
                "currency_code": "USD",
                "customer_id": "__test__KyVnHhSBWlv242pN",
                "date": 1517505921,
                "deleted": false,
                "exchange_rate": 1,
                "gateway": "chargebee",
                "gateway_account_id": "gw___test__KyVnGlSBWltEk29Z",
                "id": "txn___test__KyVnHhSBWlv4j2pT",
                "id_at_gateway": "cb___test__KyVnHhSBWlv4q2pU",
                "linked_invoices": [
                    {
                        "applied_amount": 1395,
                        "applied_at": 1517505921,
                        "invoice_date": 1517505920,
                        "invoice_id": "__demo_inv__3",
                        "invoice_status": "paid",
                        "invoice_total": 1395
                    },
                    {..}
                ],
                "linked_refunds": [],
                "masked_card_number": "************1111",
                "object": "transaction",
                "payment_method": "card",
                "payment_source_id": "pm___test__KyVnHhSBWlv2z2pP",
                "resource_version": 1517505921000,
                "status": "success",
                "subscription_id": "__test__KyVnHhSBWlv242pN",
                "type": "payment",
                "updated_at": 1517505921
            }
        },
        {..}
    ],
    "next_offset": "[\"1600622718000\",\"266000001127\"]"
}

URL Format GET

https://{site}.chargebee.com/api/v2/transactions

Method

limit[]
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset[]
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
include_deleted[]
optional, boolean, default=false
If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
sort_by[<sort-order>]
optional, string filter
Sorts based on the specified attribute.
Supported attributes : date, updated_at
Supported sort-orders : asc, desc

Example sort_by[asc] = "date"
This will sort the result based on the 'date' attribute in ascending(earliest first) order.
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
optional, string filter
Uniquely identifies the transaction. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "txn_88ybdbsnvf2"
id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
customer_id[<operator>]
optional, string filter
Identifier of the customer for which this transaction is made. Possible values are :
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example customer_id[is] = "5hjdk8nOpd"
customer_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
customer_id[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
customer_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
customer_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
subscription_id[<operator>]
optional, string filter
Identifier of the subscription for which this transaction is made. Possible values are :
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example subscription_id[is] = "5hjdk8nOpd"
subscription_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
subscription_id[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
subscription_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
subscription_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
payment_source_id[<operator>]
optional, string filter
To filter based on Transaction payment source id. Possible values are :
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example payment_source_id[is] = "pm_3Nl8XXUQUXDVFa2"
payment_source_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
payment_source_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
payment_source_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
payment_source_id[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
payment_source_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
payment_source_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
payment_method[<operator>]
optional, enumerated string filter
The payment method of this transaction. Possible values are : card, cash, check, chargeback, bank_transfer, amazon_payments, paypal_express_checkout, direct_debit, alipay, unionpay, apple_pay, wechat_pay, ach_credit, sepa_credit, ideal, google_pay, sofort, bancontact, giropay, dotpay, other, upi, netbanking_emandates, custom, boleto, venmo, pay_to, faster_payments, sepa_instant_transfer, automated_bank_transfer, klarna_pay_now, online_banking_poland, payconiq_by_bancontact
Supported operators : is, is_not, in, not_in

Example payment_method[is] = "card"
payment_method[is][operator]
optional, enumerated string filter
Possible values are : card, cash, check, chargeback, bank_transfer, amazon_payments, paypal_express_checkout, direct_debit, alipay, unionpay, apple_pay, wechat_pay, ach_credit, sepa_credit, ideal, google_pay, sofort, bancontact, giropay, dotpay, other, upi, netbanking_emandates, custom, boleto, venmo, pay_to, faster_payments, sepa_instant_transfer, automated_bank_transfer, klarna_pay_now, online_banking_poland, payconiq_by_bancontact
Supported operators :

Example
payment_method[is_not][operator]
optional, enumerated string filter
Possible values are : card, cash, check, chargeback, bank_transfer, amazon_payments, paypal_express_checkout, direct_debit, alipay, unionpay, apple_pay, wechat_pay, ach_credit, sepa_credit, ideal, google_pay, sofort, bancontact, giropay, dotpay, other, upi, netbanking_emandates, custom, boleto, venmo, pay_to, faster_payments, sepa_instant_transfer, automated_bank_transfer, klarna_pay_now, online_banking_poland, payconiq_by_bancontact
Supported operators :

Example
payment_method[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
payment_method[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
gateway[<operator>]
optional, enumerated string filter
Gateway through which this transaction was done. Applicable only for 'Card' Payment Method. Possible values are : chargebee, chargebee_payments, adyen, stripe, wepay, braintree, authorize_net, paypal_pro, pin, eway, eway_rapid, worldpay, balanced_payments, beanstream, bluepay, elavon, first_data_global, hdfc, migs, nmi, ogone, paymill, paypal_payflow_pro, sage_pay, tco, wirecard, amazon_payments, paypal_express_checkout, gocardless, orbital, moneris_us, moneris, bluesnap, cybersource, vantiv, checkout_com, paypal, ingenico_direct, exact, mollie, quickbooks, razorpay, global_payments, bank_of_america, ecentric, metrics_global, windcave, pay_com, ebanx, dlocal, nuvei, solidgate, paystack, jp_morgan, not_applicable
Supported operators : is, is_not, in, not_in

Example gateway[is] = "stripe"
gateway[is][operator]
optional, enumerated string filter
Possible values are : chargebee, chargebee_payments, adyen, stripe, wepay, braintree, authorize_net, paypal_pro, pin, eway, eway_rapid, worldpay, balanced_payments, beanstream, bluepay, elavon, first_data_global, hdfc, migs, nmi, ogone, paymill, paypal_payflow_pro, sage_pay, tco, wirecard, amazon_payments, paypal_express_checkout, gocardless, orbital, moneris_us, moneris, bluesnap, cybersource, vantiv, checkout_com, paypal, ingenico_direct, exact, mollie, quickbooks, razorpay, global_payments, bank_of_america, ecentric, metrics_global, windcave, pay_com, ebanx, dlocal, nuvei, solidgate, paystack, jp_morgan, not_applicable
Supported operators :

Example
gateway[is_not][operator]
optional, enumerated string filter
Possible values are : chargebee, chargebee_payments, adyen, stripe, wepay, braintree, authorize_net, paypal_pro, pin, eway, eway_rapid, worldpay, balanced_payments, beanstream, bluepay, elavon, first_data_global, hdfc, migs, nmi, ogone, paymill, paypal_payflow_pro, sage_pay, tco, wirecard, amazon_payments, paypal_express_checkout, gocardless, orbital, moneris_us, moneris, bluesnap, cybersource, vantiv, checkout_com, paypal, ingenico_direct, exact, mollie, quickbooks, razorpay, global_payments, bank_of_america, ecentric, metrics_global, windcave, pay_com, ebanx, dlocal, nuvei, solidgate, paystack, jp_morgan, not_applicable
Supported operators :

Example
gateway[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
gateway[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
gateway_account_id[<operator>]
optional, string filter
The gateway account used for this transaction. Possible values are :
Supported operators : is, is_not, starts_with, in, not_in

Example gateway_account_id[is] = "gw_3Nl9BNeQ7438Ks1"
gateway_account_id[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
gateway_account_id[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
gateway_account_id[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
gateway_account_id[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
gateway_account_id[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
id_at_gateway[<operator>]
optional, string filter
The id with which this transaction is referred in gateway. Possible values are :
Supported operators : is, is_not, starts_with

Example id_at_gateway[is] = "txn_5678HJS89900"
id_at_gateway[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id_at_gateway[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
id_at_gateway[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
reference_number[<operator>]
optional, string filter
The reference number for this transaction. For example, the check number when payment_method = check. Possible values are :
Supported operators : is, is_not, starts_with, is_present

Example reference_number[is] = "cus_u239732"
reference_number[is][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
reference_number[is_not][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
reference_number[starts_with][operator]
optional, string, min chars=1 filter
Possible values are :
Supported operators :

Example
reference_number[is_present][operator]
optional, enumerated string filter
Possible values are : true, false
Supported operators :

Example
type[<operator>]
optional, enumerated string filter
Type of the transaction. Possible values are : authorization, payment, refund, payment_reversal
Supported operators : is, is_not, in, not_in

Example type[is] = "payment"
type[is][operator]
optional, enumerated string filter
Possible values are : authorization, payment, refund, payment_reversal
Supported operators :

Example
type[is_not][operator]
optional, enumerated string filter
Possible values are : authorization, payment, refund, payment_reversal
Supported operators :

Example
type[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
type[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
date[<operator>]
optional, timestamp(UTC) in seconds filter
Indicates when this transaction occurred. Possible values are :
Supported operators : after, before, on, between

Example date[after] = "1435054328"
date[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
date[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
amount[<operator>]
optional, number filter
Amount for this transaction. Possible values are :
Supported operators : is, is_not, lt, lte, gt, gte, between

Example amount[is] = "1200"
amount[is][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[is_not][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[lt][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[lte][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[gt][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[gte][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
amount_capturable[<operator>]
optional, number filter
To filter based on transaction’s unused authorized/blocked amount. Possible values are :
Supported operators : is, is_not, lt, lte, gt, gte, between

Example amount_capturable[is] = "1200"
amount_capturable[is][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[is_not][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[lt][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[lte][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[gt][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[gte][operator]
optional, number filter
Possible values are :
Supported operators :

Example
amount_capturable[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[<operator>]
optional, enumerated string filter
The status of this transaction. Possible values are : in_progress, success, voided, failure, timeout, needs_attention, late_failure
Supported operators : is, is_not, in, not_in

Example status[is] = "success"
status[is][operator]
optional, enumerated string filter
Possible values are : in_progress, success, voided, failure, timeout, needs_attention, late_failure
Supported operators :

Example
status[is_not][operator]
optional, enumerated string filter
Possible values are : in_progress, success, voided, failure, timeout, needs_attention, late_failure
Supported operators :

Example
status[in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
status[not_in][operator]
optional, string filter
Possible values are :
Supported operators :

Example
updated_at[<operator>]
optional, timestamp(UTC) in seconds filter
To filter based on updated_at. This attribute will be present only if the resource has been updated after 2016-09-28. It is advisable when using this filter, to pass the sort_by input parameter as updated_at for a faster response. Possible values are :
Supported operators : after, before, on, between

Example updated_at[after] = "1243545465"
updated_at[after][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[before][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[on][operator]
optional, timestamp(UTC) in seconds filter
Possible values are :
Supported operators :

Example
updated_at[between][operator]
optional, string filter
Possible values are :
Supported operators :

Example
transaction transaction
always returned
Resource object representing transaction
next_offset next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x
Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual & automatic) made for this invoice.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/invoices/__demo_inv__4/payments \
     -G  \
     -u {site_api_key}:\
     --data-urlencode limit=1
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "list": [
        {
            "transaction": {
                "amount": 100,
                "amount_unused": 0,
                "base_currency_code": "USD",
                "currency_code": "USD",
                "customer_id": "__test__KyVnHhSBWlvSM2pk",
                "date": 1600968323,
                "deleted": false,
                "exchange_rate": 1,
                "fraud_reason": "Payment complete.",
                "gateway": "stripe",
                "gateway_account_id": "gw___test__KyVnGlSBWltbL2AB",
                "id": "txn___test__KyVnHhSBWlvlh2pw",
                "id_at_gateway": "ch_1HUyC7Jv9j0DyntJJ6FrzqKp",
                "linked_invoices": [
                    {
                        "applied_amount": 100,
                        "applied_at": 1517505924,
                        "invoice_date": 1517505923,
                        "invoice_id": "__demo_inv__4",
                        "invoice_status": "payment_due",
                        "invoice_total": 1095
                    },
                    {..}
                ],
                "linked_refunds": [],
                "masked_card_number": "************1111",
                "object": "transaction",
                "payment_method": "card",
                "payment_source_id": "pm___test__KyVnHhSBWlvgw2pl",
                "resource_version": 1517505924000,
                "status": "success",
                "subscription_id": "__test__KyVnHhSBWlvi12pp",
                "type": "payment",
                "updated_at": 1517505924
            }
        },
        {..}
    ]
}

URL Format GET

https://{site}.chargebee.com/api/v2/invoices/{invoice-id}/payments

Method

limit[]
optional, integer, default=10, min=1, max=100
The number of resources to be returned.
offset[]
optional, string, max chars=1000
Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set offset to the value of next_offset obtained in the previous iteration of the API call.
transaction transaction
always returned
Resource object representing transaction
next_offset next_offset
optional, string, max chars=1000
This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter `offset`.

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x
Retrieve a transaction identified by its unique id.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnHhSBWlxBX2qV \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 100,
        "amount_unused": 0,
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnHhSBWlwxY2qJ",
        "date": 1600968329,
        "deleted": false,
        "exchange_rate": 1,
        "fraud_reason": "Payment complete.",
        "gateway": "stripe",
        "gateway_account_id": "gw___test__KyVnGlSBWltbL2AB",
        "id": "txn___test__KyVnHhSBWlxBX2qV",
        "id_at_gateway": "ch_1HUyCDJv9j0DyntJaAcmSVfG",
        "linked_invoices": [
            {
                "applied_amount": 100,
                "applied_at": 1517505929,
                "invoice_date": 1517505928,
                "invoice_id": "__demo_inv__6",
                "invoice_status": "payment_due",
                "invoice_total": 1095
            },
            {..}
        ],
        "linked_refunds": [],
        "masked_card_number": "************1111",
        "object": "transaction",
        "payment_method": "card",
        "payment_source_id": "pm___test__KyVnHhSBWlx6v2qK",
        "resource_version": 1517505929000,
        "status": "success",
        "subscription_id": "__test__KyVnHhSBWlx8C2qO",
        "type": "payment",
        "updated_at": 1517505929
    }
}

URL Format GET

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}

Method

transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x
This API deletes an offline transaction. However, to delete an offline transaction all payment allocations associated with the transaction must be removed.

Notes

Sample Request
Try in API Explorer
curl  https://{site}.chargebee.com/api/v2/transactions/txn___test__KyVnHhSBWluhp2pD/delete_offline_transaction \
     -X POST  \
     -u {site_api_key}:
copy
Click to Copy

Sample Response [ JSON ]

Show more...
{
    "transaction": {
        "amount": 895,
        "amount_unused": 895,
        "base_currency_code": "USD",
        "currency_code": "USD",
        "customer_id": "__test__KyVnGlSBWluMI2AM",
        "date": 1517505919,
        "deleted": true,
        "exchange_rate": 1,
        "gateway": "not_applicable",
        "id": "txn___test__KyVnHhSBWluhp2pD",
        "linked_invoices": [],
        "linked_refunds": [],
        "object": "transaction",
        "payment_method": "bank_transfer",
        "resource_version": 1517505919000,
        "status": "success",
        "type": "payment",
        "updated_at": 1517505919
    }
}

URL Format POST

https://{site}.chargebee.com/api/v2/transactions/{transaction-id}/delete_offline_transaction

Method

comment[]
optional, string, max chars=300
Reason for deleting this transaction. This comment will be added to the associated entity.
transaction transaction
always returned
Resource object representing transaction

Sample admin console URL

https://{site}.chargebee.com/admin-console/transactions/123x