This resource represents the transaction event that has happened in your account.

Sample transaction [ JSON ]

{ "id": "txn_3Nl8GHMQ9Vb9esE", "customer_id": "8avVGOkx8U1MX", "subscription_id": "8avVGOkx8U1MX", "gateway_account_id": "gw_3Nl8GHMQ9Vb6YY2", "payment_method": "card", "gateway": "chargebee", "type": "payment", "date": 1414780221, "exchange_rate": 1.0, "amount": 900, "id_at_gateway": "cb_3Nl8GHMQ9Vb9f2F", "status": "success", "updated_at": 1414780221, "resource_version": 1414780221000, "deleted": false, "object": "transaction", "masked_card_number": "************1111", "currency_code": "USD", "base_currency_code": "USD", "amount_unused": 0, "linked_invoices": [ { "invoice_id": "1", "applied_amount": 900, "applied_at": 1414780221, "invoice_date": 1414780220, "invoice_total": 900, "invoice_status": "paid" }, {..} ], "linked_refunds": [] }

API Index URL GET

https://{site}.chargebee.com/api/v2/transactions
id
Uniquely identifies the transaction.
string, max chars=40
customer_id
Identifier of the customer for which this transaction is made.
optional, string, max chars=50
subscription_id
Identifier of the subscription for which this transaction is made.
optional, string, max chars=50
gateway_account_id
The gateway account used for this transaction.
optional, string, max chars=50
payment_method
The Payment Method of this transaction.
enumerated string, default=card
Possible values are
cardCard.cashCash.checkCheck.chargebackChargeback.
bank_transferBank Transfer.amazon_paymentsAmazon Payments.paypal_express_checkoutPaypal Express Checkout.direct_debitDirect Debit.otherPayment Methods other than the above types.
Show all values[+]
reference_number
The reference number for this transaction. e.g check number in case of 'check' payments.
optional, string, max chars=100
gateway
Gateway through which this transaction was done. Applicable only for 'Card' Payment Method.
enumerated string
Possible values are
chargebeeChargebee test gateway.stripeStripe payment gateway.wepayWePay Gateway.braintreeBraintree payment gateway.
authorize_netAuthorize.net payment gateway.paypal_proPaypal Pro Account.pinPin payment gateway.ewayeWAy Account.eway_rapideWAy Rapid gateway.worldpayWorldPay payment gateway.balanced_paymentsBalanced payment gateway.beanstreamBeanstream Account.bluepayBluePay payment gateway.elavonElavon Virtual Merchant.first_data_globalFirst Data Global Gateway Virtual Terminal Account.hdfcHDFC Account.migsMasterCard Internet Gateway Service.nmiNMI gateway.ogoneOgone Account.paymillPaymill payment gateway.paypal_payflow_proPaypal Payflow Pro gateway.sage_paySage Pay gateway.tco2Checkout payment gateway.wirecardWireCard Account.gocardlessGoCardless.not_applicableIndicates that payment gateway is not applicable for this resource.
Show all values[+]
type
Type of the transaction.
enumerated string
Possible values are
authorizationAuthorization transaction.paymentIndicates the payment has been executed sucessfully.refundIndicates a refund transaction.payment_reversalIndicates a reversal transaction.
date
Indicates when this transaction occurred.
optional, timestamp(UTC) in seconds
currency_code
The currency code (ISO 4217 format) for the transaction.
string, max chars=3
amount
Amount for this transaction.
optional, in cents, min=1
id_at_gateway
The id with which this transaction is referred in gateway.
optional, string, max chars=100
status
The status of this transaction.
optional, enumerated string
Possible values are
in_progressTransaction is being processed via ACH.successTransaction is sucessful.voidedTransaction got voided.failureTransaction failed. Refer the 'error_code' and 'error_text' fields to know the reason for failure.timeoutTransaction failed because of Gateway not accepting the connection.needs_attentionConnection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually.
error_code
Error code received from the payment gateway on failure.
optional, string, max chars=100
error_text
Error message received from the payment gateway on failure.
optional, string, max chars=65k
voided_at
Timestamp indicating when this transaction made void. Applicable only for the void transactions.
optional, timestamp(UTC) in seconds
resource_version
Version number of this resource. Each update of this resource results in incremental change of this number. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, long
updated_at
Timestamp indicating when this transaction was last updated. This attribute will be present only if the resource has been updated after 2016-09-28.
optional, timestamp(UTC) in seconds
amount_unused
Unused amount present for this transaction. Applicable only for Payments.
optional, in cents, min=0
masked_card_number
The masked card number used for this transaction. Applicable only for 'Card' Payment Method.
optional, string, max chars=20
reference_transaction_id
Reference payment id. Applicable only for refund and reversal transactions.
optional, string, max chars=40
refunded_txn_id
Original transaction id that got refunded. Applicable only for refund transactions.
optional, string, max chars=40
reversal_transaction_id
Reversal transaction id. Applicable only for payment transactions.
optional, string, max chars=40
deleted
Indicates that this resource has been deleted.
boolean
linked_invoices
Show attributes[+]
Applicable only for 'Payment' transactions. The list of invoices this 'payment' transaction is applied to.
optional, list of invoice_transaction
Linked invoice attributes
invoice_id
Identifier for the invoice.
string, max chars=50
applied_amount
The transaction amount applied to this invoice.
in cents, min=0
applied_at
Timestamp at which the transaction is applied.
timestamp(UTC) in seconds
invoice_date
The date this invoice is issued.
optional, timestamp(UTC) in seconds
invoice_total
Total amount of the invoice.
optional, in cents, min=0
invoice_status
Current status of this invoice.
enumerated string
Possible values are
paidIndicates a paid invoice.postedIndicates the payment is not yet collected and will be in this state till the due date to indicate the due period.payment_dueIndicates the payment is not yet collected and is being retried as per retry settings.not_paidIndicates the payment is not made and all attempts to collect is failed.voidedIndicates a voided invoice.pendingIndicates the invoice is not closed yet. New line items can be added when the invoice is in this state.
linked_credit_notes
Show attributes[+]
Applicable only for 'Refund' transactions. The list of Credit Notes this 'refund' transaction is associated with.
optional, list of credit_note_transaction
Linked credit note attributes
cn_id
Identifier for the credit-notes.
string, max chars=50
applied_amount
The transaction amount applied to this invoice.
in cents, min=0
applied_at

timestamp(UTC) in seconds
cn_reason_code
The reason for issuing this Credit Note. The following reason codes are supported now.
enumerated string, default=product_unsatisfactory
Possible values are
write_offThis reason will be set automatically for the Credit Notes created during invoice Write Off operation.subscription_changeThis reason will be set automatically for Credit Notes created during Change Subscription operation when proration is enabled.subscription_cancellationThis reason will be set automatically for Credit Notes created during cancel subscription operation.chargebackCan be set when you are recording your customer Chargebacks.
product_unsatisfactoryProduct Unsatisfactory.service_unsatisfactoryService Unsatisfactory.order_changeOrder Change.order_cancellationOrder Cancellation.waiverWaiver.otherCan be set when none of the above reason codes are applicable.
Show all values[+]
cn_date
The date this credit note is created.
optional, timestamp(UTC) in seconds
cn_total
Total amount of the credit note.
optional, in cents, default=0, min=0
cn_status
The status of this Credit Note.
enumerated string
Possible values are
adjustedWhen the Credit Note has been adjusted against an invoice.refundedWhen the entire credits (Credit Note amount) have been used (i.e either allocated to invoices or refunded).refund_dueWhen the credits are yet to be used, or have been partially used.voidedWhen the Credit Note has been canceled.
cn_reference_invoice_id
The invoice number. Acts as a identifier for invoice and typically generated sequentially.
string, max chars=50
linked_refunds
Show attributes[+]
Applicable only for Payment transactions. The list of refunds issued for for this Payment. .
optional, list of txn_refunds_and_reversal
Linked refund attributes
txn_id
Uniquely identifies the transaction.
string, max chars=40
txn_status
The status of this transaction.
enumerated string
Possible values are
in_progressTransaction is being processed via ACH.successTransaction is sucessful.voidedTransaction got voided.failureTransaction failed. Refer the 'error_code' and 'error_text' fields to know the reason for failure.timeoutTransaction failed because of Gateway not accepting the connection.needs_attentionConnection with Gateway got terminated abruptly. So, status of this transaction needs to be resolved manually.
txn_date
Indicates when this refund occured.
timestamp(UTC) in seconds
txn_amount
Amount of this refund transaction.
in cents, min=1
Lists all the transactions.
Sample Request
curl  https://{site}.chargebee.com/api/v2/transactions \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5" \
     --data-urlencode payment_method[is]="card" \
     --data-urlencode status[is]="success" \
     --data-urlencode sort_by[asc]="date"
copy
curl  https://{site}.chargebee.com/api/v2/transactions \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5" \
     --data-urlencode payment_method[is_not]="card" \
     --data-urlencode status[is_not]="success" \
     --data-urlencode sort_by[asc]="date"

Sample Response [ JSON ]

{ "list": [ {"transaction": { "id": "txn_263BJvQ9VbK4WL", "customer_id": "3Nl8GHMQ9VbIqN5e", "subscription_id": "3Nl8GHMQ9VbIqN5e", "gateway_account_id": "gw_3Nl8GHMQ9VbIrD5m", "payment_method": "card", "gateway": "stripe", "type": "payment", "date": 1485518282, "exchange_rate": 1.0, "amount": 1000, "id_at_gateway": "ch_A0ZVIeTR2ktqiu", "status": "success", "updated_at": 1485518283, "resource_version": 1485518283000, "deleted": false, "object": "transaction", "masked_card_number": "************4242", "currency_code": "USD", "base_currency_code": "USD", "amount_unused": 0, "linked_invoices": [ { "invoice_id": "29", "applied_amount": 1000, "applied_at": 1485518283, "invoice_date": 1485518280, "invoice_total": 1000, "invoice_status": "paid" }, {..} ], "linked_refunds": [] }}, {..} ], "next_offset": "[\"1485518282000\",\"135000000041\"]" }

URL Format GET

https://{site}.chargebee.com/api/v2/transactions
limit
Limits the number of resources to be returned.
optional, integer, default=10, min=1, max=100
offset
Allows you to fetch the next set of resources. The value used for this parameter must be the value returned for next_offset parameter in the previous API call.
optional, string, max chars=1000
include_deleted
If set to true, includes the deleted resources in the response. For the deleted resources in the response, the 'deleted' attribute will be 'true'.
optional, boolean, default=false
sort_by[<sort-order>]
Sorts based on the specified attribute.
Supported attributes : date
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.
optional, string filter
Filter Params
For operator usages, see the Pagination and Filtering section.
id[<operator>]
To filter based on Transaction Id.
Supported operators : is, is_not, starts_with, in, not_in

Example id[is] = "txn_88ybdbsnvf2"
optional, string filter
customer_id[<operator>]
To filter based on Transaction Customer Id.
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example customer_id[is] = "5hjdk8nOpd"
optional, string filter
subscription_id[<operator>]
To filter based on Transaction Subscription Id.
Supported operators : is, is_not, starts_with, is_present, in, not_in

Example subscription_id[is] = "5hjdk8nOpd"
optional, string filter
payment_method[<operator>]
To filter based on Transaction Payment Method. Possible values are : card, cash, check, chargeback, bank_transfer, amazon_payments, paypal_express_checkout, direct_debit, other.
Supported operators : is, is_not, in, not_in

Example payment_method[is] = "card"
optional, enumerated string filter
gateway[<operator>]
To filter based on Transaction Gateway. Possible values are : chargebee, 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, gocardless, not_applicable.
Supported operators : is, is_not, in, not_in

Example gateway[is_not] = "stripe"
optional, enumerated string filter
gateway_account_id[<operator>]
To filter based on Transaction Gateway Credential Id.
Supported operators : is, is_not, starts_with, in, not_in

Example gateway_account_id[is] = "gw_3Nl9BNeQ7438Ks1"
optional, string filter
id_at_gateway[<operator>]
To filter based on Transaction Id At Gateway.
Supported operators : is, is_not, starts_with

Example id_at_gateway[is] = "txn_5678HJS89900"
optional, string filter
reference_number[<operator>]
To filter based on Transaction Reference Number.
Supported operators : is, is_not, starts_with, is_present

Example reference_number[is] = "cus_u239732"
optional, string filter
type[<operator>]
To filter based on Transaction Type. Possible values are : authorization, payment, refund, payment_reversal.
Supported operators : is, is_not, in, not_in

Example type[is_not] = "payment"
optional, enumerated string filter
date[<operator>]
To filter based on Transaction Date.
Supported operators : after, before, on, between

Example date[on] = "1435054328"
optional, timestamp(UTC) in seconds filter
amount[<operator>]
To filter based on Transaction Amount.
Supported operators : is, is_not, lt, lte, gt, gte, between

Example amount[is] = "1200"
optional, in cents filter
status[<operator>]
To filter based on Transaction Status. Possible values are : in_progress, success, voided, failure, timeout, needs_attention.
Supported operators : is, is_not, in, not_in

Example status[is] = "success"
optional, enumerated string filter
updated_at[<operator>]
To filter based on updated at. This attribute will be present only if the resource has been updated after 2016-09-28.
Supported operators : after, before, on, between

Example updated_at[after] = "1243545465"
optional, timestamp(UTC) in seconds filter
Resource object representing transaction.
always returned
next_offset
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”.
optional, string, max chars=1000
Retrieves the payments for an invoice with the recent ones on top. This returns all the payment attempts(manual & automatic) made for this invoice.
Sample Request
curl  https://{site}.chargebee.com/api/v2/invoices/1/payments \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5"
copy
curl  https://{site}.chargebee.com/api/v2/invoices/1/payments \
     -G  \
     -u {site_api_key}: \
     --data-urlencode limit="5"

Sample Response [ JSON ]

{"list": [ {"transaction": { "id": "txn_3Nl8GHMQ9Vb9esE", "customer_id": "8avVGOkx8U1MX", "subscription_id": "8avVGOkx8U1MX", "gateway_account_id": "gw_3Nl8GHMQ9Vb6YY2", "payment_method": "card", "gateway": "chargebee", "type": "payment", "date": 1414780221, "exchange_rate": 1.0, "amount": 900, "id_at_gateway": "cb_3Nl8GHMQ9Vb9f2F", "status": "success", "updated_at": 1414780221, "resource_version": 1414780221000, "deleted": false, "object": "transaction", "masked_card_number": "************1111", "currency_code": "USD", "base_currency_code": "USD", "amount_unused": 0, "linked_invoices": [ { "invoice_id": "1", "applied_amount": 900, "applied_at": 1414780221, "invoice_date": 1414780220, "invoice_total": 900, "invoice_status": "paid" }, {..} ], "linked_refunds": [] }}, {..} ]}

URL Format GET

https://{site}.chargebee.com/api/v2/invoices/{invoice_id}/payments
limit
Limits the number of resources to be returned.
optional, integer, default=10, min=1, max=100
offset
Allows you to fetch the next set of resources. The value used for this parameter must be the value returned for next_offset parameter in the previous API call.
optional, string, max chars=1000
Resource object representing transaction.
always returned
next_offset
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”.
optional, string, max chars=1000
Retrieve a transaction identified by its unique id.
Sample Request
curl  https://{site}.chargebee.com/api/v2/transactions/txn_3Nl8GHMQ9Vb9esE \
     -u {site_api_key}:
copy
curl  https://{site}.chargebee.com/api/v2/transactions/txn_3Nl8GHMQ9Vb9esE \
     -u {site_api_key}:

Sample Response [ JSON ]

{"transaction": { "id": "txn_3Nl8GHMQ9Vb9esE", "customer_id": "8avVGOkx8U1MX", "subscription_id": "8avVGOkx8U1MX", "gateway_account_id": "gw_3Nl8GHMQ9Vb6YY2", "payment_method": "card", "gateway": "chargebee", "type": "payment", "date": 1414780221, "exchange_rate": 1.0, "amount": 900, "id_at_gateway": "cb_3Nl8GHMQ9Vb9f2F", "status": "success", "updated_at": 1414780221, "resource_version": 1414780221000, "deleted": false, "object": "transaction", "masked_card_number": "************1111", "currency_code": "USD", "base_currency_code": "USD", "amount_unused": 0, "linked_invoices": [ { "invoice_id": "1", "applied_amount": 900, "applied_at": 1414780221, "invoice_date": 1414780220, "invoice_total": 900, "invoice_status": "paid" }, {..} ], "linked_refunds": [] }}

URL Format GET

https://{site}.chargebee.com/api/v2/transactions/{transaction_id}
Resource object representing transaction.
always returned

Sample admin console URL

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