Skip to main content

Mandate

Struct Mandate 

Source
pub struct Mandate {
Show 17 fields pub approval_redirect: Option<PaymentRedirect>, pub approved_at: Option<DateTime<Utc>>, pub asset: Asset, pub canceled_at: Option<DateTime<Utc>>, pub created_at: DateTime<Utc>, pub customer_display: Option<MandateCustomerDisplay>, pub expires_at: Option<DateTime<Utc>>, pub mandate_id: MandateId, pub metadata: Option<Metadata>, pub policy: MandatePolicy, pub revocation_redirect: Option<PaymentRedirect>, pub revocation_url: Option<Url>, pub revoked_at: Option<DateTime<Utc>>, pub source: Option<MandateSource>, pub status: MandateStatus, pub updated_at: DateTime<Utc>, pub url: Option<Url>,
}
Expand description

A durable, revocable standing authorization to debit a funding source without the customer present each time, within its policy caps. Payment sessions draw against it by referencing its mandateId.

`source` is set once an approval succeeds. `status` reflects the most recent action; the `approvedAt`, `canceledAt`, and `revokedAt` timestamps are the durable record of what has happened. Ending one mandate does not affect other mandates on the same `source`.
JSON schema
{
 "description": "A durable, revocable standing authorization to debit a funding `source` without the customer present each time, within its `policy` caps. Payment sessions draw against it by referencing its `mandateId`.\n\n`source` is set once an approval succeeds. `status` reflects the most recent action; the `approvedAt`, `canceledAt`, and `revokedAt` timestamps are the durable record of what has happened. Ending one mandate does not affect other mandates on the same `source`.",
 "examples": [
   {
     "approvalRedirect": {
       "failureUrl": "https://merchant.example.com/mandate/approval/failed",
       "successUrl": "https://merchant.example.com/mandate/approval/success"
     },
     "approvedAt": "2025-06-15T12:05:00.000Z",
     "asset": "usdc",
     "createdAt": "2025-06-15T12:00:00.000Z",
     "customerDisplay": {
       "merchantName": "Acme Store"
     },
     "expiresAt": "2027-06-15T12:00:00.000Z",
     "mandateId": "mandate_82c879c1-84e1-44ed-a8c2-1ac239cf09ad",
     "metadata": {
       "customer_id": "cust_12345"
     },
     "policy": {
       "maxPerAuthorization": "50.00",
       "maxPerPeriod": {
         "amount": "500.00",
         "period": "month"
       }
     },
     "revocationRedirect": {
       "failureUrl": "https://merchant.example.com/mandate/revocation/failed",
       "successUrl": "https://merchant.example.com/mandate/revocation/success"
     },
     "revocationUrl": "https://payments.coinbase.com/mandates/mandate_82c879c1-84e1-44ed-a8c2-1ac239cf09ad/revoke",
     "source": {
       "address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
       "asset": "usdc",
       "network": "base"
     },
     "status": "approval_succeeded",
     "updatedAt": "2025-06-15T12:05:00.000Z"
   }
 ],
 "type": "object",
 "required": [
   "asset",
   "createdAt",
   "mandateId",
   "policy",
   "status",
   "updatedAt"
 ],
 "properties": {
   "approvalRedirect": {
     "description": "Optional merchant URLs used by the hosted mandate approval flow. The approval page redirects to `successUrl` when approval succeeds, or `failureUrl` when it fails. When omitted, the approval page keeps the customer on the Coinbase-hosted experience.",
     "examples": [
       {
         "failureUrl": "https://merchant.example.com/mandate/approval/failed",
         "successUrl": "https://merchant.example.com/mandate/approval/success"
       }
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/PaymentRedirect"
       }
     ]
   },
   "approvedAt": {
     "description": "The UTC ISO 8601 timestamp at which an approval succeeded and the mandate became usable. Present only once the mandate has been approved; set once, on the successful approval, and unchanged by later transitions. Its presence is the durable signal that the mandate was approved, independent of `status`.",
     "examples": [
       "2026-08-21T13:55:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "asset": {
     "description": "The unit of account the mandate's `policy` caps are denominated in (e.g., `500` means 500 of this asset). Fixed at creation. This is only the denomination for the limits; the funding `source` may hold a different asset (for example, limits in `usdc` against a `usdt` source). Each authorization's amount is converted into this asset at authorization time to evaluate the caps, so the caps are always enforced in a single denomination.",
     "examples": [
       "usdc"
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/Asset"
       }
     ]
   },
   "canceledAt": {
     "description": "The UTC ISO 8601 timestamp at which the merchant canceled the mandate off-chain. Present only once the mandate has been canceled. Canceling does not touch the on-chain spending allowance; check `revokedAt` for that.",
     "examples": [
       "2026-08-21T14:02:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "createdAt": {
     "description": "The UTC ISO 8601 timestamp at which the mandate was created.",
     "examples": [
       "2025-06-15T12:00:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "customerDisplay": {
     "$ref": "#/components/schemas/MandateCustomerDisplay"
   },
   "expiresAt": {
     "description": "The UTC ISO 8601 timestamp after which the mandate can no longer be authorized against. Authorization attempts after this time return `422`; `status` does not change. Omit for no expiry.",
     "examples": [
       "2027-06-15T12:00:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "mandateId": {
     "description": "The unique identifier of the mandate.",
     "examples": [
       "mandate_82c879c1-84e1-44ed-a8c2-1ac239cf09ad"
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/MandateId"
       }
     ]
   },
   "metadata": {
     "$ref": "#/components/schemas/Metadata"
   },
   "policy": {
     "description": "Debit caps. Always present. If you omitted `policy` at create, this is a Coinbase-configured monthly max.",
     "examples": [
       {
         "maxPerAuthorization": "50.00",
         "maxPerPeriod": {
           "amount": "500.00",
           "period": "month"
         }
       }
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/MandatePolicy"
       }
     ]
   },
   "revocationRedirect": {
     "description": "Optional merchant URLs used by the hosted mandate revocation flow. The revocation page redirects to `successUrl` when revocation succeeds, or `failureUrl` when it fails. When omitted, the revocation page keeps the customer on the Coinbase-hosted experience.",
     "examples": [
       {
         "failureUrl": "https://merchant.example.com/mandate/revocation/failed",
         "successUrl": "https://merchant.example.com/mandate/revocation/success"
       }
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/PaymentRedirect"
       }
     ]
   },
   "revocationUrl": {
     "description": "Hosted page where the customer can remove their spending allowance for this mandate. Present once the mandate has a `source` (from `approval_succeeded` onward); absent before approval, when there is nothing to revoke.",
     "readOnly": true,
     "examples": [
       "https://payments.coinbase.com/mandates/mandate_82c879c1-84e1-44ed-a8c2-1ac239cf09ad/revoke"
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/Url"
       }
     ]
   },
   "revokedAt": {
     "description": "The UTC ISO 8601 timestamp at which the spending allowance was removed on-chain by a wallet revocation. Present only once that has happened. Its presence is the single signal that the allowance is gone, independent of `status` (for example, it can be set on a `canceled` mandate whose allowance was later cleaned up).",
     "examples": [
       "2026-08-21T14:12:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "source": {
     "description": "The funding source the mandate draws against. Set when an approval succeeds. Not present before the mandate is `approval_succeeded`.",
     "examples": [
       {
         "address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
         "asset": "usdc",
         "network": "base"
       }
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/MandateSource"
       }
     ]
   },
   "status": {
     "description": "The current status of the mandate.",
     "examples": [
       "approval_succeeded"
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/MandateStatus"
       }
     ]
   },
   "updatedAt": {
     "description": "The UTC ISO 8601 timestamp at which the mandate was last updated.",
     "examples": [
       "2025-06-15T12:00:00.000Z"
     ],
     "type": "string",
     "format": "date-time"
   },
   "url": {
     "description": "Hosted page where the customer approves this mandate. Present only before the mandate reaches `approval_succeeded`; complemented by `revocationUrl` afterward.",
     "readOnly": true,
     "examples": [
       "https://payments.coinbase.com/mandates/mandate_82c879c1-84e1-44ed-a8c2-1ac239cf09ad"
     ],
     "allOf": [
       {
         "$ref": "#/components/schemas/Url"
       }
     ]
   }
 }
}

Fields§

§approval_redirect: Option<PaymentRedirect>

Optional merchant URLs used by the hosted mandate approval flow. The approval page redirects to successUrl when approval succeeds, or failureUrl when it fails. When omitted, the approval page keeps the customer on the Coinbase-hosted experience.

§approved_at: Option<DateTime<Utc>>

The UTC ISO 8601 timestamp at which an approval succeeded and the mandate became usable. Present only once the mandate has been approved; set once, on the successful approval, and unchanged by later transitions. Its presence is the durable signal that the mandate was approved, independent of status.

§asset: Asset

The unit of account the mandate’s policy caps are denominated in (e.g., 500 means 500 of this asset). Fixed at creation. This is only the denomination for the limits; the funding source may hold a different asset (for example, limits in usdc against a usdt source). Each authorization’s amount is converted into this asset at authorization time to evaluate the caps, so the caps are always enforced in a single denomination.

§canceled_at: Option<DateTime<Utc>>

The UTC ISO 8601 timestamp at which the merchant canceled the mandate off-chain. Present only once the mandate has been canceled. Canceling does not touch the on-chain spending allowance; check revokedAt for that.

§created_at: DateTime<Utc>

The UTC ISO 8601 timestamp at which the mandate was created.

§customer_display: Option<MandateCustomerDisplay>§expires_at: Option<DateTime<Utc>>

The UTC ISO 8601 timestamp after which the mandate can no longer be authorized against. Authorization attempts after this time return 422; status does not change. Omit for no expiry.

§mandate_id: MandateId

The unique identifier of the mandate.

§metadata: Option<Metadata>§policy: MandatePolicy

Debit caps. Always present. If you omitted policy at create, this is a Coinbase-configured monthly max.

§revocation_redirect: Option<PaymentRedirect>

Optional merchant URLs used by the hosted mandate revocation flow. The revocation page redirects to successUrl when revocation succeeds, or failureUrl when it fails. When omitted, the revocation page keeps the customer on the Coinbase-hosted experience.

§revocation_url: Option<Url>

Hosted page where the customer can remove their spending allowance for this mandate. Present once the mandate has a source (from approval_succeeded onward); absent before approval, when there is nothing to revoke.

§revoked_at: Option<DateTime<Utc>>

The UTC ISO 8601 timestamp at which the spending allowance was removed on-chain by a wallet revocation. Present only once that has happened. Its presence is the single signal that the allowance is gone, independent of status (for example, it can be set on a canceled mandate whose allowance was later cleaned up).

§source: Option<MandateSource>

The funding source the mandate draws against. Set when an approval succeeds. Not present before the mandate is approval_succeeded.

§status: MandateStatus

The current status of the mandate.

§updated_at: DateTime<Utc>

The UTC ISO 8601 timestamp at which the mandate was last updated.

§url: Option<Url>

Hosted page where the customer approves this mandate. Present only before the mandate reaches approval_succeeded; complemented by revocationUrl afterward.

Implementations§

Trait Implementations§

Source§

impl Clone for Mandate

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Mandate

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Mandate

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl From<&Mandate> for Mandate

Source§

fn from(value: &Mandate) -> Self

Converts to this type from the input type.
Source§

impl From<Mandate> for Mandate

Source§

fn from(value: Mandate) -> Self

Converts to this type from the input type.
Source§

impl Serialize for Mandate

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<Mandate> for Mandate

Source§

type Error = ConversionError

The type returned in the event of a conversion error.
Source§

fn try_from(value: Mandate) -> Result<Self, ConversionError>

Performs the conversion.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more