Updates a transaction by its ID. Only transactions with status `draft` or `ready` can be updated.

paddle_update_transaction(
  id,
  status = NULL,
  customer_id = NULL,
  address_id = NULL,
  business_id = NULL,
  custom_data = NULL,
  currency_code = NULL,
  collection_mode = NULL,
  discount_id = NULL,
  billing_details = NULL,
  payment_terms = NULL,
  billing_period = NULL,
  items = NULL,
  checkout_url = NULL,
  include = NULL
)

Arguments

id

Character. Required. Paddle ID of the transaction (e.g. `"txn_abc123"`).

status

Character. Optional. `"billed"` or `"canceled"`.

customer_id, address_id, business_id

Character. Optional Paddle IDs.

custom_data

Named list. Optional.

currency_code

Character. Optional. `"USD"`, `"EUR"`, or `"GBP"` if `collection_mode = "manual"`.

collection_mode

Character. Optional. `"automatic"` or `"manual"`.

discount_id

Character. Optional.

billing_details

List. Optional, see API.

payment_terms

List with `interval` and `frequency`. Shortcut to fill `billing_details$payment_terms`.

billing_period

List with `starts_at` and `ends_at` in RFC 3339 format. Optional.

items

List of objects with `price_id` and `quantity`. Optional.

checkout_url

Character. Optional.

include

Character vector of related entities to return. Optional.

Value

A list with updated transaction data and metadata.

Examples

if (FALSE) { # paddle_has_token()
set_paddle_mode("sandbox")
result <- paddle_create_transaction(
 items = list(
 list(price_id = "price_123", quantity = 1)
 )
)
}