Just launched
We're actively working on new content and improvements to our documentation. We'd love to hear your thoughts, launch quick survey
Paddle Billing
Search

Create a transaction

Transactions are the central billing entity in Paddle. Create a transaction to collect using checkout or invoice. Paddle automatically creates transactions for subscription lifecycle events.

To bill a customer, you need a transaction. It holds all the information about a charge you're billing for, including customer details, items, calculated tax and localized pricing, and payments.

Paddle automatically creates transactions for subscription lifecycle events and when checkouts are opened, but you can create your own transactions using the API or Dashboard. You might do this when:

  • You have an interactive pricing page where customers can configure their subscription before signing up. You can create a transaction for the items a customer has chosen, then pass to a checkout.
  • You create quotes or deals in a CRM or ERP solution and want to integrate with Paddle.

How it works

Transactions are at the heart of Paddle. They tie together products, prices, and discounts with customers to calculate and capture revenue for checkouts, invoices, and subscriptions.

All revenue in Paddle is calculated and captured using transactions. Paddle creates transactions automatically for subscription lifecycle events and when checkouts are opened, and you may also create your own transactions using the API.

Transactions are initially created as draft or ready, depending on the information supplied. As you work with a transaction entity, they move to completed:

  1. Draft

    draft transactions are missing required fields for billing. Checkouts opened by Paddle.js with only items create draft transactions, since they're missing customer and address information initially.

  2. Ready

    Transactions are ready when they have all the required fields for billing. When Paddle Checkout captures customer name, country and (in some regions) ZIP or postal code, then transactions move to ready.

  3. Billed

    You may optionally mark a transaction as billed. At this point, it's considered a financial record and can't be changed. This is typically used as part of an invoicing workflow to issue an invoice, or to prevent a customer from changing items or quantities at checkout.

  4. Paid

    When Paddle collects payment successfully, transactions are automatically paid. This is an interim status while completed transaction processing happens. Paddle updates the transaction with information about fees, earnings, and totals for payouts. It also adds the related subscription_id and invoice_number for automatically-collected transactions.

  5. Completed

    After all transaction processing is completed, transactions are automatically completed.

Completed transaction processing usually takes less than a second, so you won't typically encounter transactions that are paid when working with the API.

Paddle automatically sets transactions as draft, ready, paid, and completed. You can set transactions as billed or canceled using the API.

This guide focuses on creating automatically-collected transactions. You can also create manually-collected transactions, meaning Paddle sends your customer an invoice document that must be paid manually.

Before you begin

Transactions work with products and prices to say what you're billing for, so you'll need to create a product and a related price.

To create a ready transaction, you'll also need to:

Create a draft transaction

Draft transactions contain an items list, but don't include address or customer details which are required for billing.

Send a POST request to the /transactions endpoint.

POSThttps://api.paddle.com/transactions

Request

Transactions work with price entities to say what you're billing for. Include a list of items, with an object containing price ID and quantity for each in your request.

Recurring items on a transaction must have the same billing interval. For example, you can't have a transaction with some prices that are billed monthly and some products that are billed annually.

Response

If successful, Paddle responds with a copy of the new transaction entity with the status of draft.

The new transaction has collection_mode as automatic, which means Paddle collects automatically using a saved payment method. If no payment method is saved, customers must enter one using Paddle Checkout.

There are no calculated taxes, since Paddle doesn't have address information.

Create a ready transaction

Ready transactions contain an items list and all required fields for billing, including address and customer details.

Send a POST request to the /transactions endpoint.

POSThttps://api.paddle.com/transactions

Along with items, you must include:

customer_idstring

Paddle ID of the customer that this transaction is for.

address_idstring

Paddle ID of the address that this transaction is for.

Request

Transactions work with price entities to say what you're billing for. Include a list of items, with an object containing price ID and quantity for each in your request.

In your request, include customer_id and address_id. You may optionally include a business_id, too.

Response

If successful, Paddle responds with a copy of the new transaction entity with the status of ready.

The new transaction has collection_mode as automatic, which means Paddle collects automatically using a saved payment method. If no payment method is saved, customers must enter one using Paddle Checkout.

Update a transaction

While your transaction is draft or ready, you can make changes to it and the items on it. You can work with items, apply a discount, change customer information, or add or remove custom data.

If you're working with a draft transaction, when it includes items, customer_id, and address_id then Paddle automatically marks it as ready.

Send a PATCH request to the /transactions/{transaction_id} endpoint.

Transactions are financial records. You can't edit them if they're billed, canceled, or completed. Cancel a transaction and create another or create an adjustment if you need to make changes to a billed or completed transaction.

Request

This example adds a discount to a transaction. Apply a discount by including discount_id in your request.

Response

If successful, Paddle responds with a copy of the updated transaction entity.

Update transaction items

To update transaction items, include the items array in your request.

Updating transaction items works like a PUT request. You should send the complete list of transaction items that you'd like to be against your entity — including any existing items. If you omit an item, it's removed from the transaction items list. See: Work with lists

Change collection mode

While your transaction is draft or ready, you can switch between automatic and manual collection modes.

See: Change transaction collection mode

Mark a transaction as billed

You can mark a transaction as billed to say it's finalized, meaning it's considered a financial record and cannot be changed.

This is typically used for manually-collected transactions (invoices), as part of an invoicing workflow. Marking a transaction as billed is essentially issuing an invoice. It gets an invoice number and is sent to your customer.

You don't need to mark an automatically-collected transaction as billed, and it's not typically part of a self-service workflow. However, you may like to do this if you plan to create a checkout for this transaction to prevent a customer from changing items or quantities at checkout.

You can create a transaction and mark it as billed by including "status": "billed" in your initial request, along with the other required fields — no need to make a separate request.

Request

This example marks a transaction as billed.

Response

If successful, Paddle responds with a copy of the updated transaction entity with the status of billed.

Transactions are financial records. You can't edit them if they're billed, canceled, or completed. Cancel a transaction and create another or create an adjustment if you need to make changes to a billed or completed transaction.

Pass a transaction to a checkout

Automatically-collected transactions include checkout.url, which you can send to customers to open a checkout to capture payment details for this transaction.

You can also pass a transaction ID to a checkout using Paddle.js to collect for it.

See: Pass a transaction to a checkout

Notifications

transaction.createdOccurs when a transaction is created initially.
transaction.updatedOccurs when a transaction is updated, excluding status changes.
transaction.readyOccurs when a transaction is ready to be billed. It has all of the required fields for billing.
transaction.billedOccurs when a transaction is marked as billed.

Related pages