Update a Transaction
PATCH https://api.chartmogul.com/v1/transactions/{TRANSACTION_UUID}
Updates a transaction identified by its UUID.
curl -X PATCH "https://api.chartmogul.com/v1/transactions/tr_c9e3f5ff-a091-4232-a7b9-234632fb1754" \
-u YOUR_API_KEY: \
-H "Content-Type: application/json" \
-d '{
"amount_in_cents": 10000
}'
{
"uuid": "tr_c9e3f5ff-a091-4232-a7b9-234632fb1754",
"external_id": null,
"type": "refund",
"date": "2022-12-25T18:10:00.000Z",
"result": "successful",
"amount_in_cents": 10000,
"transaction_fees_in_cents": 0,
"transaction_fees_currency": null,
"disabled": false,
"disabled_at": null,
"disabled_by": null,
"user_created": false
}
This endpoint supports identifying the transaction either by its transaction_uuid path parameter or by a combination of external_id and data_source_uuid query parameters.
Path parameters
transaction_uuidstring optional- The ChartMogul UUID of the transaction to be updated. If provided, this value is used to identify the transaction.
Query parameters
external_idstring optional- A unique external identifier of the transaction that you want to update. Required together with
data_source_uuidiftransaction_uuidis not provided. data_source_uuidstring optional- The ChartMogul UUID of the data source the transaction belongs to. Required together with
external_idiftransaction_uuidis not provided. handle_as_user_editboolean optional default: false- Valid only for automatic sources (Stripe, Chargebee, Recurly, Braintree, Google Play, App Store Connect and SaaSync integrations); ignored for others.
true— The transaction update is stored as a user edit and persists through resyncs and reimports.false— The transaction update is treated as system-generated and may be overwritten or removed during resyncs and reimports.
Body parameters
typestring optional- Either
paymentorrefund. datestring optional- The timestamp of when the transaction was attempted. Must be an ISO 8601-formatted time. The timezone defaults to UTC unless otherwise specified. The time defaults to
00:00:00unless specified otherwise. resultstring optional- Either
successfulorfaileddepending on the result of this attempted transaction. amount_in_centsint32 optional- The partial amount in cents (or pence for GBP, etc.) paid/refunded for this invoice. Defaults to the full amount. The sum of the partial payments/refunds should not exceed the invoiced amount.
transaction_fees_in_centsint32 optional default: 0- The amount of transaction fees in cents (or pence for GBP, etc.). Defaults to zero.
transaction_fees_currencystring optional- The three-letter currency code for
transaction_fees_in_cents, e.g. USD, EUR, GBP. Refer to the full list of supported currencies.
Response
The response object contains the following data:
uuid- The UUID of the transaction object generated by ChartMogul.
external_id- The unique external identifier for this transaction, as specified by you.
type- One of payment or refund, as specified by you.
date- The timestamp of when the transaction was attempted, as specified by you.
result- The result of the transaction attempt. One of successful or failed, as specified by you.
amount_in_cents- The amount partially paid/refunded for this transaction.
transaction_fees_in_cents- The final total transaction fees paid to a billing provider and/or payment processor for this transaction. Expressed in cents (or pence for GBP, etc.).
transaction_fees_currency- The three-letter currency code for
transaction_fees_in_cents. Refer to the full list of supported currencies. disabled- A boolean stating whether or not the transaction was disabled.
disabled_by- The email address of the team member who disabled the transaction (
nullfor non-disabled records). disabled_at- The date and time when the transaction was disabled (
nullfor non-disabled records). user_created- A boolean stating whether or not the transaction was created by the team member for one of the automatic sources (Stripe, Chargebee, Recurly, Braintree, Google Play, App Store Connect and SaaSync integrations).