Money Button Documentation

Money Button Documentation

  • Money Button
  • API
  • Examples
  • Paymail
  • bsv

›API v1

Money Button

  • Money Button Overview
  • HTML
  • Javascript
  • React
  • Crypto Operations
  • Invisible Money Button
  • Paymail Signatures
  • Paymail Encryption
  • Simple Fabriik Protocol for Tokens

API

  • API Overview
  • Apps
  • Webhooks
  • Tokens
  • Currencies
  • Javascript Client
  • Authentication

    • Authentication Overview
    • OAuth
    • OAuth With JS Client

    API v1

    • Get User Identity
    • Get User Profile
    • Get User Balance
    • Get Payments
    • Get Payment By ID

    API v2

    • Get User Balances
    • Get Payments
    • Get Payment By ID
    • Get Assets
    • Create Asset
    • Modify Asset

Examples

  • Examples Overview
  • OP_RETURN Scripts
  • Assets

Paymail

  • Paymail Overview
  • Paymail Video Series
  • Paymail Introduction
  • BRFC Specifications
  • Specification Documents
  • BRFC ID Assignment
  • Service Discovery
  • Host Discovery
  • Capability Discovery
  • Public Key Infrastructure
  • Payment Addressing
  • Payment Addressing (Basic Address Resolution)
  • Payment Addressing (Payer Validation)
  • Payment Addressing (Payee Approvals)
  • Payment Addressing (PayTo Protocol Prefix)
  • Verify Public Key Owner
  • P2P Transactions
  • P2P Payment Destination
  • Recommendations

Bitcoin SV Library (bsv)

  • Bitcoin SV Library (bsv)
  • Big Numbers
  • Points (Elliptic Curves)
  • Hash Functions
  • Base 58
  • Private Keys
  • Public Keys
  • Addresses
  • ECDSA
  • Bitcoin Signed Messages
  • Signatures
  • HD Private Keys (BIP32)
  • HD Public Keys (BIP32)
  • Mnemonics (BIP39)
  • Script

Get Payments

Returns a collection of payments belonging to the current user or app.

Facts

AttributeValue
urlhttps://www.moneybutton.com/api/v1/payments
http verbGET
Required scopepayments:read or application_access:write

Attributes

Query

  • limit: Max amount of payments to return. Default 20.
  • offset: Number of payments to skip.

Example Response

{
  "data": [
    {
      "type": "payments",
      "id": "51",
      "attributes": {
        "created-at": "2019-07-16T13:54:17.609Z",
        "user-id": "7",
        "txid": null,
        "normalized-txid": "4bf355a3acba1cf69e76db52bce9236f481cd3e4cacc16b49224294c2567fb8f",
        "amount": "0.00918671551247386",
        "currency": "USD",
        "satoshis": "7507",
        "status": "FAILED",
        "status-description": "Timed out.",
        "button-id": "1563285222434",
        "button-data": "{\"unDato\": \"un valor loco\", \"unDatoCompuesto\": {\"coso\": 3, \"cosito\": \"valor del cosito\"}}",
        "amount-usd": "0.00918671551247386",
        "input-amount-usd": "116.75309980698881",
        "input-amount-satoshis": "95405754",
        "spend-amount-usd": "0.00028023949012342004",
        "spend-amount-satoshis": "229",
        "fee-amount-usd": "0.00028023949012342004",
        "fee-amount-satoshis": "229",
        "change-amount-usd": "116.74363285198622",
        "change-amount-satoshis": "95398018"
      },
      "relationships": {
        "payment-outputs": {
          "data": [
            {
              "type": "payment-outputs",
              "id": "54"
            }
          ]
        }
      }
    },
    {
      "type": "payments",
      "id": "77",
      "attributes": {
        "created-at": "2019-08-21T21:37:12.819Z",
        "user-id": "7",
        "txid": null,
        "normalized-txid": "dc734013433cca2cf15916e330acc65acbe35b4e4821479915a065c992a9cf4b",
        "amount": "0.9999997399525015",
        "currency": "USD",
        "satoshis": "746676",
        "status": "FAILED",
        "status-description": "Timed out.",
        "button-id": "1566423247979",
        "button-data": "{}",
        "amount-usd": "0.9999997399525015",
        "input-amount-usd": "122.91629988533867",
        "input-amount-satoshis": "91778675",
        "spend-amount-usd": "1.0003064324676607",
        "spend-amount-satoshis": "746905",
        "fee-amount-usd": "0.00030669251515935003",
        "fee-amount-satoshis": "229",
        "change-amount-usd": "121.91599345287102",
        "change-amount-satoshis": "91031770"
      },
      "relationships": {
        "payment-outputs": {
          "data": [
            {
              "type": "payment-outputs",
              "id": "82"
            }
          ]
        }
      }
    }
  ],
  "included": [
    {
      "type": "payment-outputs",
      "id": "54",
      "attributes": {
        "created-at": "2019-07-16T13:54:17.614Z",
        "to": "7",
        "amount": "1",
        "currency": "ALL",
        "satoshis": "7507",
        "type": "USER",
        "user-id": "7",
        "address": null,
        "script": null,
        "amount-usd": "0.009186954524575104",
        "user-paymail": "johndoe@example.com"
      }
    },
    {
      "type": "payment-outputs",
      "id": "82",
      "attributes": {
        "created-at": "2019-08-21T21:37:12.820Z",
        "to": "5",
        "amount": "1",
        "currency": "USD",
        "satoshis": "746676",
        "type": "USER",
        "user-id": "5",
        "address": null,
        "script": null,
        "amount-usd": "1",
        "user-paymail": "jennyrandom@example.io"
      }
    }
  ]
}

Using our js api client

const mbClient = new MoneyButtonClient(CLIENT_IDENTIFIER, CLIENT_SECRET)
await mbClient.logInAsApp()
const payments = await mbClient.getOwnPayments()
const data = payments.map (p => ({id: p.id, amount: p.amount, currency: p.currency}))
console.log(data)
// Output:
// [
//   {
//     id: 51,
//     amount: '0.00918671551247386',
//     currency: 'USD'
//   },
//   {
//     id: 77,
//     amount: '0.9999997399525015',
//     currency: 'USD'
//   }
// ]
← Get User BalanceGet Payment By ID →
  • Facts
  • Attributes
    • Query
  • Example Response
  • Using our js api client
Money Button Documentation
Docs
Money ButtonAPIDesignbsv
Community
redditYoutubeTelegramTwitter
More
BlogInstagramGitHubStar
See an error in our documentation? Issue a pull request to fix it.
Copyright © 2021 Yours Inc.