POST
/
sponsors
/
{sponsor_id}
/
contribute
cURL
curl --request POST \
  --url http://localhost:8080/sponsors/{sponsor_id}/contribute \
  --header 'Content-Type: application/json' \
  --data '
{
  "amount": 123,
  "insurance_policy_id": "<string>"
}
'
{
  "amount": {
    "value": 123
  },
  "insurance_policy_id": "<string>",
  "provider_transfer_id": "<string>",
  "sponsor_id": "<string>",
  "status": "<string>",
  "user_id": "012345678901"
}

Path Parameters

sponsor_id
string
required

Sponsor ID

Body

application/json
amount
number<double>
required
insurance_policy_id
string
required

Response

Contribution transferred

amount
object
required
insurance_policy_id
string
required
provider_transfer_id
string
required
sponsor_id
string
required
status
string
required
user_id
string
required

A validated 12-digit numeric user identifier.

Every external entry point validates:

  • JSON Deserialize runs [UserId::parse] (outer whitespace trimmed, length and digit-only enforced) via #[serde(try_from = "String")].
  • DB FromSql runs [UserId::parse] on every row read.

Display / Deref<Target = str> / AsRef<str> / Into<String> are derived via derive_more — the inner String is pass-through for every read-only borrow, display, and move-out.

Example:

"012345678901"