Create full adjustments without specifying transaction items
Refund or credit the grand total for a transaction by passing a new field when creating an adjustment. There's no need to extract items from the transaction list.
What's new?
We've added a new type
field that you can use when creating an adjustment to specify that the grand total for a transaction should be refunded or credited.
Type of adjustment. Use full
to adjust the grand total for the related transaction. Include an items
array when creating a partial
adjustment. If omitted, defaults to partial
.
How it works
You can use adjustments to refund or credit all or part of a transaction and its items.
Previously, to refund or credit all of a transaction then you'd need to get and extract information about all the items on a transaction, then build an array of adjustment items.
We've updated the Paddle API so now you can pass a new type
field when creating an adjustment. When type
is full
, you don't need to specify an array of items. Paddle creates an adjustment for the grand total for a transaction.
If omitted, type
default to partial
, which mirrors the existing behavior.
Examples
Request
This example creates a refund for all items on an automatically-collected transaction.
1234561{
2 "action": "refund",
3 "transaction_id": "txn_01jc679dkb1a5ytsn6vat4m4vt",
4 "reason": "error",
5 "type": "full"
6}
Response
If successful, the response includes the new adjustment entity. It includes an items
array with all line items for all items on a transaction.
12345678910111213141516171819201{
2 "data": {
3 "id": "adj_01jee666qcymxwrqy007wms2xa",
4 "action": "refund",
5 "type": "full",
6 "transaction_id": "txn_01jc679dkb1a5ytsn6vat4m4vt",
7 "subscription_id": "sub_01jc67mq0yhherf6rmrtf4n2hh",
8 "customer_id": "ctm_01jc67jy72jegfk1k72wk87wrg",
9 "reason": "error",
10 "currency_code": "USD",
11 "status": "pending_approval",
12 "items": [
13 {
14 "id": "adjitm_01jee666qwy5kk7zswwwtg4b4r",
15 "item_id": "txnitm_01jc67jykqp90vmqchzxax3dgs",
16 "type": "full",
17 "amount": "194381",
18 "proration": null,
19 "totals": {
20 "subtotal": "194381",
Summary of changes
Fields
This is a summary of the changes to fields in the Paddle API:
Field | Change | Notes |
---|---|---|
adjustment.type | New field | Determines whether an adjustment is for the grand total of a transaction or some items against it. |
Next steps
This change is available in version 1
of the Paddle API.
It's a non-breaking change, meaning it doesn't impact existing integrations.
Check out our refund or credit a transaction guide to get started.