| POST | /cmd/cashbook/entries |
|---|
#![allow(
dead_code,
non_camel_case_types,
non_snake_case,
clippy::upper_case_acronyms
)]
use serde::{Deserialize, Serialize};
use serde_json::Value;
use std::collections::HashMap;
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct Money {
pub amount: f64,
pub currency: String,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Default)]
#[serde(default)]
pub struct CreateCashbookEntry {
#[serde(default, skip_serializing_if = "Option::is_none")]
pub id: Option<String>,
#[serde(rename = "locationId")]
#[serde(default, skip_serializing_if = "Option::is_none")]
pub location_id: Option<String>,
#[serde(rename = "chargedAt")]
pub charged_at: String,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub amount: Option<Money>,
#[serde(default, skip_serializing_if = "Option::is_none")]
pub description: Option<String>,
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/cashbook/entries HTTP/1.1
Host: api.bettor.webhop.biz
Accept: text/csv
Content-Type: text/csv
Content-Length: length
{"id":"String","locationId":"String","chargedAt":"0001-01-01T00:00:00.0000000Z","amount":{"amount":0,"currency":"String"},"description":"String"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}