open_payments/types

Types

The access rights granted to (or requested for) an access token. Shared by grant requests and access token responses. Access types not defined by the Open Payments spec are kept as AccessOther, with their type as kind and their raw actions.

pub type Access {
  AccessIncoming(
    actions: List(IncomingAction),
    identifier: option.Option(String),
  )
  AccessOutgoing(
    actions: List(OutgoingAction),
    identifier: String,
    limits: option.Option(Limits),
  )
  AccessQuote(actions: List(QuoteAction))
  AccessOther(kind: String, actions: List(String))
}

Constructors

See https://openpayments.dev/apis/auth-server/operations/post-token/

pub type AccessTokenResponse {
  AccessTokenResponse(
    value: String,
    manage: String,
    expires_in: option.Option(Int),
    access: List(Access),
  )
}

Constructors

  • AccessTokenResponse(
      value: String,
      manage: String,
      expires_in: option.Option(Int),
      access: List(Access),
    )

A monetary amount, expressed as a value in the asset’s minor unit together with the asset code and scale needed to interpret it.

pub type Amount {
  Amount(value: String, asset_code: String, asset_scale: Int)
}

Constructors

  • Amount(value: String, asset_code: String, asset_scale: Int)

A debitAmount/receiveAmount pair, of which at most one is present. Shared by outgoing payment grant limits and quote creation.

pub type AmountOption {
  NoAmount
  DebitAmount(Amount)
  ReceiveAmount(Amount)
}

Constructors

The actions that can be granted or exercised on incoming payments. Actions not defined by the Open Payments spec are kept as IncomingOther.

pub type IncomingAction {
  IncomingCreate
  IncomingComplete
  IncomingRead
  IncomingReadAll
  IncomingList
  IncomingListAll
  IncomingOther(String)
}

Constructors

  • IncomingCreate
  • IncomingComplete
  • IncomingRead
  • IncomingReadAll
  • IncomingList
  • IncomingListAll
  • IncomingOther(String)

A public key in JWK format, as published on a wallet address’s JWKS endpoint or sent as part of a client-directed-identity grant request. Open Payments only allows Ed25519 signing keys, so the JWK’s fixed members ("alg": "EdDSA", "kty": "OKP", "crv": "Ed25519" and "use": "sig") are not stored; they are written when encoding and checked when decoding.

pub type Key {
  Key(kid: String, x: String)
}

Constructors

  • Key(kid: String, x: String)

Limits placed on an outgoing payment grant, restricting the receiver, interval, and/or amount that payments made under the grant may use.

pub type Limits {
  Limits(
    receiver: option.Option(String),
    interval: option.Option(String),
    amount: AmountOption,
  )
}

Constructors

The actions that can be granted or exercised on outgoing payments. Actions not defined by the Open Payments spec are kept as OutgoingOther.

pub type OutgoingAction {
  OutgoingCreate
  OutgoingRead
  OutgoingReadAll
  OutgoingList
  OutgoingListAll
  OutgoingOther(String)
}

Constructors

  • OutgoingCreate
  • OutgoingRead
  • OutgoingReadAll
  • OutgoingList
  • OutgoingListAll
  • OutgoingOther(String)

Cursor pagination info shared by list responses.

pub type PageInfo {
  PageInfo(
    start_cursor: option.Option(String),
    end_cursor: option.Option(String),
    has_next_page: Bool,
    has_previous_page: Bool,
  )
}

Constructors

  • PageInfo(
      start_cursor: option.Option(String),
      end_cursor: option.Option(String),
      has_next_page: Bool,
      has_previous_page: Bool,
    )

The actions that can be granted or exercised on quotes. Actions not defined by the Open Payments spec are kept as QuoteOther.

pub type QuoteAction {
  QuoteCreate
  QuoteRead
  QuoteReadAll
  QuoteOther(String)
}

Constructors

  • QuoteCreate
  • QuoteRead
  • QuoteReadAll
  • QuoteOther(String)
✨ Search Document