Skip to content

Instantly share code, notes, and snippets.

@mjallday
Created October 1, 2013 16:33
Show Gist options
  • Save mjallday/6781288 to your computer and use it in GitHub Desktop.
Save mjallday/6781288 to your computer and use it in GitHub Desktop.
New API Example

Create an API key

curl https://api-pm.balancedpayments.com/api_keys -XPOST -H "Accept: application/vnd.api+json;version=1.1"

Will return a response with a secret param

{
  "links": {},
  "api_keys": [
    {
      "links": {},
      "created_at": "2013-10-01T16:31:13.515773Z",
      "secret": "e32bf6f22ab611e38213026ba7d88541",
      "href": "/api_keys/AK6UFRHZeoigBwBIJKPpQ8iR",
      "meta": {},
      "id": "AK6UFRHZeoigBwBIJKPpQ8iR"
    }
  ]
}

Create a marketplace

curl https://api-pm.balancedpayments.com/marketplaces -XPOST -H "Accept: application/vnd.api+json;version=1.1" -u e32bf6f22ab611e38213026ba7d88541:

Returns a marketplace

{
  "marketplaces": [
    {
      "in_escrow": 0,
      "domain_url": "example.com",
      "name": "Test Marketplace",
      "links": {
        "owner_customer": "CUrfczZhtKxfheQlrdGJmt4"
      },
      "href": "/marketplaces/TEST-MPreuxB9XqPRN7cg7G9FOjg",
      "created_at": "2013-10-01T16:32:26.093625Z",
      "support_email_address": "support@example.com",
      "updated_at": "2013-10-01T16:32:26.670622Z",
      "support_phone_number": "+16505551234",
      "production": false,
      "meta": {},
      "unsettled_fees": 0,
      "id": "TEST-MPreuxB9XqPRN7cg7G9FOjg"
    }
  ],
  "links": {
    "marketplaces.debits": "/debits",
    "marketplaces.reversals": "/reversals",
    "marketplaces.customers": "/customers",
    "marketplaces.credits": "/credits",
    "marketplaces.cards": "/cards",
    "marketplaces.card_holds": "/card_holds",
    "marketplaces.refunds": "/refunds",
    "marketplaces.owner_customer": "/customers/{marketplaces.owner_customer}",
    "marketplaces.transactions": "/transactions",
    "marketplaces.bank_accounts": "/bank_accounts",
    "marketplaces.callbacks": "/callbacks",
    "marketplaces.events": "/events"
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment