Crates.io | square-ox |
lib.rs | square-ox |
version | 0.2.0 |
source | src |
created_at | 2022-07-25 20:43:51.379369 |
updated_at | 2022-09-07 01:03:36.371362 |
description | An easy, idiomatic, and flexible way of interacting with the Square API, following Rust conventions. |
homepage | |
repository | https://github.com/emilHof/square-ox |
max_upload_size | |
id | 632824 |
size | 502,942 |
A crate for accessing the Square API Rest endpoint in an idiomatic manner.
Using this crate you are able to formulate standard queries to the Square API without
worrying about the underlying workflows and specific JSON schemas.
A square-rs fork
use square_ox::client::SquareClient;
let client = SquareClient::new("your_access_token");
// listing all locations
let locations = client.locations().list().await?;
// retrieving the count of an item in the inventory
let count = client.inventory()
.retrieve_count(
"some_obj_id".to_string(),
Some("some_loc_id".to_string())
)
.await()?;
// registering a new booking
client.bookings().create(
Builder::from(BookingsPost::default())
.start_at("2022-10-11T16:30:00Z".to_string())
.customer_id("some_id".to_string())
.add_appointment_segment(AppointmentSegment {
duration_minutes: 60.00,
team_member_id: "some_id".to_string(),
any_team_member_id: None,
intermission_minutes: None,
resource_ids: None,
service_variation_id: "some_id".to_string(),
service_variation_version: 1655427266071,
})
.build()
.await?
).await()?;