Execution Plan

The execution plan details for a given intent will provide you the details of the execution performed and will allow to track the progress.

Some of the key data items include:

#ActionDescription
1"creationTimeStamp":The timestamp for when the execution plan was initiated in epoch format
2"status":The overall status for the execution plan which can include:
Pending
Success
Failure
Unknown
3"instructions" The instructions section outlines the different steps (sequences) in the execution plan that are routed to the given organization that handles the action that is performed.
4[ { "sequence": "organizations": [
{ "organizationId":
}
Each given sequence will be outlined in the plan instructions.

organizationId - provides the organization assigned for the step
Typename - indicates the instructions (Hold, Transfer, Release)
Status - indicates if approved.
State - the given state will appear for the given structure based on if the given sequence was successful, failure, or unknown.

Success:

"state": {
"__typename": "SuccessState"
},

Failure:

The failure will be indicated by a failure code returned from the given organization and the message describing the issue that led to the failure.
"state": {
"code": 999,
"message": "not enough balance to withdraw 1000000 for 03331ffb8a4d1154f5ddef11212e552129374586219cbbe3b4c1d1efe84a089a40"
},

Unknown:

The step has not been reached potentially due to failure from the previous step.

"state": {
"__typename": "Unknown"
},

The following query for the given execution plan will bring provide the complete details of the plan, which can be used also to track its progress.

{
  plans (
    filter: {key: "id", operator: EQ, value: "<executionplanId>"}
  ) {
    nodes {
      id
      intent {
        id
        start
        end
        status
        assetTerm {
          amount
          asset {
            ... on Cryptocurrency {
              symbol
            }
            ... on FiatAsset {
              code
            }
            ... on FinP2PAsset {
              resourceId
            }
          }
        }
        assetInstruction {
          account {
            asset {
              ... on Cryptocurrency {
                symbol
              }
              ... on FiatAsset {
                code
              }
              ... on FinP2PAsset {
                resourceId
              }
            }
            identifier {
              ... on CryptoWalletAccount {
                address
              }
              ... on FinIdAccount {
                finId
                orgId
              }
              ... on Iban {
                code
              }
            }
          }
        }
        settlementTerm {
          unitValue
          asset {
            ... on Cryptocurrency {
              symbol
            }
            ... on FiatAsset {
              code
            }
            ... on FinP2PAsset {
              resourceId
            }
          }
        }
        remainingQuantity
        type
        intent {
          ... on PrimarySale {
            issuerId
            sellingSettlementInstruction {
              accounts {
                asset {
                  ... on Cryptocurrency {
                    symbol
                  }
                  ... on FiatAsset {
                    code
                  }
                  ... on FinP2PAsset {
                    resourceId
                  }
                }
                identifier {
                  ... on CryptoWalletAccount {
                    address
                  }
                  ... on FinIdAccount {
                    finId
                    orgId
                  }
                  ... on Iban {
                    code
                  }
                }
              }
            }
          }
          ... on BuyingIntent {
            buyer
            settlementInstruction {
              account {
                asset {
                  ... on Cryptocurrency {
                    symbol
                  }
                  ... on FiatAsset {
                    code
                  }
                  ... on FinP2PAsset {
                    resourceId
                  }
                }
                identifier {
                  ... on CryptoWalletAccount {
                    address
                  }
                  ... on FinIdAccount {
                    finId
                    orgId
                  }
                  ... on Iban {
                    code
                  }
                }
              }
            }
            signaturePolicyType
            signaturePolicy {
              ... on ManualIntentSignaturePolicy {
                callbackURL
              }
            }
          }
          ... on SellingIntent {
            seller
            sellingSettlementInstruction {
              accounts {
                asset {
                  ... on Cryptocurrency {
                    symbol
                  }
                  ... on FiatAsset {
                    code
                  }
                  ... on FinP2PAsset {
                    resourceId
                  }
                }
                identifier {
                  ... on CryptoWalletAccount {
                    address
                  }
                  ... on FinIdAccount {
                    finId
                    orgId
                  }
                  ... on Iban {
                    code
                  }
                }
              }
            }
            signaturePolicyType
            signaturePolicy {
              ... on ManualIntentSignaturePolicy {
                callbackURL
              }
            }
          }
          ... on LoanIntent {
            borrower
            lender
            loanSettlementInstruction {
              borrowerAccount {
                ... on FinIdAccount {
                  finId
                }
              }
              lenderAccount {
                ... on FinIdAccount {
                  finId
                }
              }
            }
                 loanInstruction {
       openDate
       closeDate              
       loanConditions {
         ... on RepaymentTerm {
           repaymentVolume
         }
        ... on InterestRate {annualPercentageRate}              }
     }
            signaturePolicyType
          }
        }
        
      }
      organizations {
        organizationId
      }
      creationTimestamp
      status
      instructions {
        sequence
        organizations {
          organizationId
        }
        details {
         __typename
          ... on IssueInstruction {
            buyer
            destinationAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
          }
          ... on HoldInstruction {
            source
            destination
            sourceAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            destinationAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            amount
          }
          ... on ReleaseInstruction {
            sourceAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            destinationAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            amount
          }
          ... on TransferInstruction {
            sourceAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            destinationAccount {
              asset {
                ... on Cryptocurrency {
                  symbol
                }
                ... on FiatAsset {
                  code
                }
                ... on FinP2PAsset {
                  resourceId
                }
              }
              identifier {
                ... on CryptoWalletAccount {
                  address
                }
                ... on FinIdAccount {
                  finId
                  orgId
                }
                ... on Iban {
                  code
                }
              }
            }
            amount
          }
          ... on AwaitInstruction {
            waitTime
          }
        }
        status
        state {
          ... on SuccessState {
            __typename
          }
          ... on ErrorState {
            code
            message
          }
          ... on UnknownState {
            __typename
          }
        }
        approvals {
          nodes {
            planId
            sequence
            orgId
            status
          }
        }
      }
      approvals {
        planId
        orgId
        status
      }
    }
  }
}
{
  "data": {
    "plans": {
      "nodes": [
        {
          "id": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
          "intent": {
            "id": "bank-de:105:aaa8423a-20b4-4934-88ef-261161ba21ea",
            "start": 1695823354,
            "end": 1696428154,
            "status": "",
            "assetTerm": {
              "amount": "5",
              "asset": {
                "resourceId": "bank-de:102:76783736-cc34-435d-b1cd-342186e96e64"
              }
            },
            "assetInstruction": {
              "account": {
                "asset": {
                  "resourceId": "bank-de:102:76783736-cc34-435d-b1cd-342186e96e64"
                },
                "identifier": {
                  "finId": "02bf73786b66be32e86f06d886745a0407334085d3b6f53cc691ba13880485f576",
                  "orgId": "bank-de"
                }
              }
            },
            "settlementTerm": {
              "unitValue": "10",
              "asset": {
                "code": "USD"
              }
            },
            "remainingQuantity": "5",
            "type": "buyingIntent",
            "intent": {
              "buyer": "bank-de:101:6bb153f6-ceff-40d2-a490-6ae85b851224",
              "settlementInstruction": {
                "account": {
                  "asset": {
                    "code": "USD"
                  },
                  "identifier": {
                    "finId": "02bf73786b66be32e86f06d886745a0407334085d3b6f53cc691ba13880485f576",
                    "orgId": "ownera-escrow"
                  }
                }
              },
              "signaturePolicyType": "ManualPolicy",
              "signaturePolicy": {
                "callbackURL": "https://bank-de-api.app.dev1.ownera.io/custody/signature/callback"
              }
            }
          },
          "organizations": [
            {
              "organizationId": "ownera-escrow"
            },
            {
              "organizationId": "bank-de"
            }
          ],
          "creationTimestamp": 1695823519,
          "status": "Completed",
          "instructions": [
            {
              "sequence": 2,
              "organizations": [
                {
                  "organizationId": "bank-de"
                }
              ],
              "details": {
                "__typename": "TransferInstruction",
                "sourceAccount": {
                  "asset": {
                    "resourceId": "bank-de:102:76783736-cc34-435d-b1cd-342186e96e64"
                  },
                  "identifier": {
                    "finId": "03c1a28142bb9120a828be931fd11c571a02e9542d5311eef5532815a0ee17822d",
                    "orgId": "bank-de"
                  }
                },
                "destinationAccount": {
                  "asset": {
                    "resourceId": "bank-de:102:76783736-cc34-435d-b1cd-342186e96e64"
                  },
                  "identifier": {
                    "finId": "02bf73786b66be32e86f06d886745a0407334085d3b6f53cc691ba13880485f576",
                    "orgId": "bank-de"
                  }
                },
                "amount": "5"
              },
              "status": "Approved",
              "state": {
                "__typename": "SuccessState"
              },
              "approvals": {
                "nodes": [
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 2,
                    "orgId": "bank-de",
                    "status": "approved"
                  },
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 2,
                    "orgId": "ownera-escrow",
                    "status": "approved"
                  }
                ]
              }
            },
            {
              "sequence": 1,
              "organizations": [
                {
                  "organizationId": "ownera-escrow"
                }
              ],
              "details": {
                "__typename": "HoldInstruction",
                "source": "bank-de:101:6bb153f6-ceff-40d2-a490-6ae85b851224",
                "destination": "bank-de:101:10afae98-ee47-4683-866b-47649b3449b4",
                "sourceAccount": {
                  "asset": {
                    "code": "USD"
                  },
                  "identifier": {
                    "finId": "02bf73786b66be32e86f06d886745a0407334085d3b6f53cc691ba13880485f576",
                    "orgId": "ownera-escrow"
                  }
                },
                "destinationAccount": {
                  "asset": {
                    "code": "USD"
                  },
                  "identifier": {
                    "finId": "03c1a28142bb9120a828be931fd11c571a02e9542d5311eef5532815a0ee17822d",
                    "orgId": "ownera-escrow"
                  }
                },
                "amount": "50"
              },
              "status": "Approved",
              "state": {
                "__typename": "SuccessState"
              },
              "approvals": {
                "nodes": [
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 1,
                    "orgId": "ownera-escrow",
                    "status": "approved"
                  },
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 1,
                    "orgId": "bank-de",
                    "status": "approved"
                  }
                ]
              }
            },
            {
              "sequence": 3,
              "organizations": [
                {
                  "organizationId": "ownera-escrow"
                }
              ],
              "details": {
                "__typename": "ReleaseInstruction",
                "sourceAccount": {
                  "asset": {
                    "code": "USD"
                  },
                  "identifier": {
                    "finId": "02bf73786b66be32e86f06d886745a0407334085d3b6f53cc691ba13880485f576",
                    "orgId": "ownera-escrow"
                  }
                },
                "destinationAccount": {
                  "asset": {
                    "code": "USD"
                  },
                  "identifier": {
                    "finId": "03c1a28142bb9120a828be931fd11c571a02e9542d5311eef5532815a0ee17822d",
                    "orgId": "ownera-escrow"
                  }
                },
                "amount": "50"
              },
              "status": "Approved",
              "state": {
                "__typename": "SuccessState"
              },
              "approvals": {
                "nodes": [
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 3,
                    "orgId": "ownera-escrow",
                    "status": "approved"
                  },
                  {
                    "planId": "bank-de:106:00355e04-31b8-4346-aeb0-f8ff27a3aaf6",
                    "sequence": 3,
                    "orgId": "bank-de",
                    "status": "approved"
                  }
                ]
              }
            }
          ],
          "approvals": []
        }
      ]
    }
  }
}