# `Daraja.C2B.RegisterUrlRequest`
[🔗](https://github.com/okothkongo/daraja/blob/v0.1.1/lib/daraja/c2b/register_url_request.ex#L1)

Input struct for a C2B Register URL request.

Required fields: `short_code`, `response_type`, `confirmation_url`, `validation_url`.

`response_type` must be either `"Completed"` or `"Cancelled"` (sentence case).
This determines what M-PESA does when the validation URL is unreachable:
- `"Completed"` — M-PESA automatically completes the transaction.
- `"Cancelled"` — M-PESA automatically cancels the transaction.

# `t`

```elixir
@type t() :: %Daraja.C2B.RegisterUrlRequest{
  confirmation_url: String.t(),
  response_type: String.t(),
  short_code: String.t(),
  validation_url: String.t()
}
```

# `new`

```elixir
@spec new(map()) ::
  {:ok, t()}
  | {:error, :invalid_request,
     [atom() | {:response_type, String.t()} | {atom(), String.t()}]}
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
