POST
/
users
/
{user_id}
/
mandate
/
register
cURL
curl --request POST \
  --url http://localhost:8080/users/{user_id}/mandate/register
{
  "account_id": "<string>",
  "amount": 123,
  "created_at": "<string>",
  "id": "<string>",
  "last_modified_at": "<string>",
  "max_amount": 123,
  "payload": "<unknown>",
  "user_id": "012345678901"
}

Path Parameters

user_id
string
required

User ID

Response

Mandate registration initiated

account_id
string
required
amount
integer<int64>
required
created_at
string
required
frequency
enum<string>
required

Debit frequency for a mandate. Mirrors Juspay's wire enum.

Available options:
AS_PRESENTED,
DAILY,
WEEKLY,
MONTHLY,
BIMONTHLY,
QUARTERLY,
HALF_YEARLY,
YEARLY,
ONE_TIME
id
string
required
last_modified_at
string
required
mandate_status
enum<string>
required

Internal mandate lifecycle status — coarse-grained view derived from the raw Juspay status string. Starts at INITIATED the moment a registration row is created (before/while the Juspay session is opened) and advances to PENDING/ACTIVE/etc. as Juspay reports progress.

Available options:
INITIATED,
PENDING,
CREATED,
ACTIVE,
LIVE,
PAUSED,
EXTERNALLY_PAUSED,
FAILED,
CANCELLED,
COMPLETED,
OTHER
max_amount
integer<int64>
required
payload
any
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"