| Crates.io | payabli_api |
| lib.rs | payabli_api |
| version | 0.0.617 |
| created_at | 2026-01-21 15:31:27.323938+00 |
| updated_at | 2026-01-21 21:29:21.696521+00 |
| description | Rust SDK for payabli_api generated by Fern |
| homepage | |
| repository | https://github.com/payabli/sdk-rust |
| max_upload_size | |
| id | 2059551 |
| size | 3,092,751 |
The Payabli Rust library provides convenient access to the Payabli APIs from Rust.
API reference documentation is available here.
Add this to your Cargo.toml:
[dependencies]
payabli_api = "0.0.617"
Or install via cargo:
cargo add payabli_api
A full reference for this library is available here.
Instantiate and use the client with the following:
use payabli_api::prelude::*;
#[tokio::main]
async fn main() {
let config = ClientConfig {
api_key: Some("<value>".to_string()),
..Default::default()
};
let client = ApiClient::new(config).expect("Failed to build client");
client
.money_in
.getpaid(
&GetpaidRequest {
body: TransRequestBody {
account_id: None,
customer_data: Some(PayorDataRequest {
additional_data: None,
billing_address_1: None,
billing_address_2: None,
billing_city: None,
billing_country: None,
billing_email: None,
billing_phone: None,
billing_state: None,
billing_zip: None,
company: None,
customer_id: Some(CustomerId(4440)),
customer_number: None,
first_name: None,
identifier_fields: None,
last_name: None,
shipping_address_1: None,
shipping_address_2: None,
shipping_city: None,
shipping_country: None,
shipping_state: None,
shipping_zip: None,
}),
entry_point: Some(Entrypointfield("f743aed24a".to_string())),
invoice_data: None,
ipaddress: Some(IpAddress("255.255.255.255".to_string())),
order_description: None,
order_id: None,
payment_details: PaymentDetail {
categories: None,
check_image: None,
check_number: None,
currency: None,
service_fee: Some(0.0),
split_funding: None,
total_amount: 100.0,
},
payment_method: PaymentMethod::PayMethodCredit(PayMethodCredit {
cardcvv: Some(Cardcvv("999".to_string())),
cardexp: Cardexp("02/27".to_string()),
card_holder: Some(Cardholder("John Cassian".to_string())),
cardnumber: Cardnumber("4111111111111111".to_string()),
cardzip: Some(Cardzip("12345".to_string())),
initiator: Some(Initiator("payor".to_string())),
method: "card".to_string(),
save_if_success: None,
}),
source: None,
subdomain: None,
subscription_id: None,
},
ach_validation: None,
force_customer_creation: None,
include_details: None,
},
None,
)
.await;
}
When the API returns a non-success status code (4xx or 5xx response), an error will be returned.
match client.money_in.getpaid(None)?.await {
Ok(response) => {
println!("Success: {:?}", response);
},
Err(ApiError::HTTP { status, message }) => {
println!("API Error {}: {:?}", status, message);
},
Err(e) => {
println!("Other error: {:?}", e);
}
}
The SDK exports all request types as Rust structs. Simply import them from the crate to access them:
use payabli_api::prelude::{*};
let request = RequestAppByAuth {
...
};
The SDK is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retryable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).
A request is deemed retryable when any of the following HTTP status codes is returned:
Use the max_retries method to configure this behavior.
let response = client.money_in.getpaid(
Some(RequestOptions::new().max_retries(3))
)?.await;
The SDK defaults to a 30 second timeout. Use the timeout method to configure this behavior.
let response = client.money_in.getpaid(
Some(RequestOptions::new().timeout_seconds(30))
)?.await;
You can add custom headers to requests using RequestOptions.
let response = client.money_in.getpaid(
Some(
RequestOptions::new()
.additional_header("X-Custom-Header", "custom-value")
.additional_header("X-Another-Header", "another-value")
)
)?
.await;
You can add custom query parameters to requests using RequestOptions.
let response = client.money_in.getpaid(
Some(
RequestOptions::new()
.additional_query_param("filter", "active")
.additional_query_param("sort", "desc")
)
)?
.await;
While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!
On the other hand, contributions to the README are always very welcome!