Crate paddle_rust_sdk

Source
Expand description

§Paddle API Client

An async client library for interaction with Paddle API, An async and ergonomic wrapper around Paddle’s REST HTTP API.

Every interaction is done via the Paddle client type.

§Init and Usage Example

use paddle_rust_sdk::Paddle;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = Paddle::new(std::env::var("PADDLE_API_KEY")?, Paddle::SANDBOX)?;

    let mut list = client.customers_list();
    let mut paginated = list.per_page(2).send();
    let customers = paginated.all().await?;

    dbg!(customers);

    Ok(())
}

The examples/ dir has up to date working example code.

§Webhook signature verification

Use the Paddle::unmarshal method to verify that received events are genuinely sent from Paddle. Additionally, this method returns the deserialized event struct.

Re-exports§

pub use error::Error;

Modules§

addresses
Builders for making requests to the Paddle API for customer addresses.
adjustments
Builders for making requests to the Paddle API for making adjustments to billed or completed transactions.
businesses
Builders for making requests to the Paddle API for customer businesses.
customers
Builders for making requests to the Paddle API for customers.
discounts
Builders for making requests to the Paddle API for discounts.
entities
Contains all Paddle entity types.
enums
This module contains enums used in the Paddle API.
error
Error handling module for Paddle API client
events
Builders for making requests to the Paddle API for previewing prices.
ids
Unique Paddle IDs
paginated
Helpers for working with paginated requests.
payment_methods
Builders for making requests to the Paddle API for customer saved payment methods.
prices
Request builders for working with price entities in Paddle API.
pricing_preview
Builders for making requests to the Paddle API for previewing prices.
products
Request builders for working with products in Paddle API.
reports
Request builders for creating and listing reports.
response
This module defines the response structures for the Paddle API.
subscriptions
Builders for making requests to the Paddle API for subscription entities.
transactions
Builders for making requests to the Paddle API for transaction entities.
webhooks
Helpers for validating webhook requests.

Structs§

Paddle
Paddle API client