Paddle.Transaction.list
You're seeing just the function
list
, go back to Paddle.Transaction module for more information.
Specs
list(String.t(), String.t(), keyword()) :: {:ok, [t()]} | {:error, Paddle.Error.t()}
Retrieve transactions for related entities within Paddle Transaction data can be retrieved using a User ID, Subscription ID, Order ID, Checkout ID (hash) or Product ID.
Can also pass page
as an additional parameter to paginate the results. Each response page return 15 results each.
params = %{
product_id: 1234,
allowed_uses: 10,
expires_at: ~D[2018-10-10]
}
Paddle.Transaction.list("user", 29777)
{:ok, [
%Paddle.Transaction{
order_id: "1042907-384786",
checkout_id: "4795118-chre895f5cfaf61-4d7dafa9df",
amount: "5.00",
currency: "USD",
status: "completed",
created_at: ~U[2017-01-22 00:38:43Z],
passthrough: nil,
product_id: 12345,
is_subscription: true,
is_one_off: false,
subscription: %{
"subscription_id" => 123456,
"status" => "active"
},
user: %{
"user_id" => 29777,
"email" => "example@paddle.com",
"marketing_consent" => true
},
receipt_url: "https://my.paddle.com/receipt/1042907-384786/4795118-chre895f5cfaf61-4d7dafa9df"
},
%Paddle.Transaction{
order_id: "1042907-384785",
checkout_id: "4795118-chre895f5cfaf61-4d7dafa9df",
amount: "5.00",
currency: "USD",
status: "refunded",
created_at: ~U[2016-12-07 12:25:09Z],
passthrough: nil,
product_id: 12345,
is_subscription: true,
is_one_off: true,
subscription: %{
"subscription_id" => 123456,
"status" => "active"
},
user: %{
"user_id" => 29777,
"email" => "example@paddle.com",
"marketing_consent" => true
},
receipt_url: "https://my.paddle.com/receipt/1042907-384785/4795118-chre895f5cfaf61-4d7dafa9df"
}
]}