pub struct Approval {
pub approval_id: ApprovalId,
pub created_at: DateTime<Utc>,
pub error: Option<PaymentError>,
pub metadata: Option<Metadata>,
pub onchain_transactions: Vec<OnchainTransaction>,
pub source: Option<MandateSource>,
pub status: ApprovalStatus,
pub updated_at: DateTime<Utc>,
}Expand description
An attempt to attach a funding source to a mandate and make it usable. A successful approval sets the mandate’s source and moves the mandate to approval_succeeded; a failed one moves the mandate to approval_failed and can be retried by submitting a new approval. A mandate holds at most one active source, so at most one approval ever succeeds. The network transactions that grant the spending allowance are on onchainTransactions.
JSON schema
{
"description": "An attempt to attach a funding source to a mandate and make it usable. A successful approval sets the mandate's `source` and moves the mandate to `approval_succeeded`; a failed one moves the mandate to `approval_failed` and can be retried by submitting a new approval. A mandate holds at most one active source, so at most one approval ever succeeds. The network transactions that grant the spending allowance are on `onchainTransactions`.",
"examples": [
{
"approvalId": "approval_5f0e9d8c-7b6a-4321-fedc-ba0987654321",
"createdAt": "2025-06-15T12:04:00.000Z",
"onchainTransactions": [
{
"network": "base",
"transactionHash": "0xabc123def456789012345678901234567890abcdef1234567890abcdef123456"
}
],
"source": {
"address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
"asset": "usdc",
"network": "base"
},
"status": "succeeded",
"updatedAt": "2025-06-15T12:05:00.000Z"
}
],
"type": "object",
"required": [
"approvalId",
"createdAt",
"status",
"updatedAt"
],
"properties": {
"approvalId": {
"description": "The unique identifier of the approval.",
"examples": [
"approval_5f0e9d8c-7b6a-4321-fedc-ba0987654321"
],
"allOf": [
{
"$ref": "#/components/schemas/ApprovalId"
}
]
},
"createdAt": {
"description": "The UTC ISO 8601 timestamp at which the approval was created.",
"examples": [
"2025-06-15T12:04:00.000Z"
],
"type": "string",
"format": "date-time"
},
"error": {
"description": "Details of why the approval failed. Only present when `status` is `failed`.",
"examples": [
{
"code": "invalid_signature",
"message": "The submitted signature was invalid.",
"occurredAt": "2025-06-15T12:04:00.000Z"
}
],
"allOf": [
{
"$ref": "#/components/schemas/PaymentError"
}
]
},
"metadata": {
"$ref": "#/components/schemas/Metadata"
},
"onchainTransactions": {
"description": "Network transactions that grant the spending allowance on-chain. Empty until the approval has been submitted to the network.",
"examples": [
[
{
"network": "base",
"transactionHash": "0xabc123def456789012345678901234567890abcdef1234567890abcdef123456"
}
]
],
"type": "array",
"items": {
"$ref": "#/components/schemas/OnchainTransaction"
}
},
"source": {
"description": "The funding source this approval binds to the mandate. Present once the source has been determined from the customer's submission.",
"examples": [
{
"address": "0xAbC1234567890aBcDeF1234567890AbCdEf123456",
"asset": "usdc",
"network": "base"
}
],
"allOf": [
{
"$ref": "#/components/schemas/MandateSource"
}
]
},
"status": {
"description": "The current status of the approval attempt.",
"examples": [
"succeeded"
],
"allOf": [
{
"$ref": "#/components/schemas/ApprovalStatus"
}
]
},
"updatedAt": {
"description": "The UTC ISO 8601 timestamp at which the approval was last updated.",
"examples": [
"2025-06-15T12:05:00.000Z"
],
"type": "string",
"format": "date-time"
}
}
}Fields§
§approval_id: ApprovalIdThe unique identifier of the approval.
created_at: DateTime<Utc>The UTC ISO 8601 timestamp at which the approval was created.
error: Option<PaymentError>Details of why the approval failed. Only present when status is failed.
metadata: Option<Metadata>§onchain_transactions: Vec<OnchainTransaction>Network transactions that grant the spending allowance on-chain. Empty until the approval has been submitted to the network.
source: Option<MandateSource>The funding source this approval binds to the mandate. Present once the source has been determined from the customer’s submission.
status: ApprovalStatusThe current status of the approval attempt.
updated_at: DateTime<Utc>The UTC ISO 8601 timestamp at which the approval was last updated.