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
rust
use square_ox::client::SquareClient;
let client = SquareClient::new("your_access_token");
```rust // listing all locations let locations = client.locations().list().await?;
// retrieving the count of an item in the inventory let count = client.inventory() .retrievecount( "someobjid".tostring(), Some("somelocid".to_string()) ) .await()?;
// registering a new booking client.bookings().create( Builder::from(BookingsPost::default()) .startat("2022-10-11T16:30:00Z".tostring()) .customerid("someid".tostring()) .addappointmentsegment(AppointmentSegment { durationminutes: 60.00, teammemberid: "someid".tostring(), anyteammemberid: None, intermissionminutes: None, resourceids: None, servicevariationid: "someid".tostring(), servicevariation_version: 1655427266071, }) .build() .await? ).await()?;
```