balanced / balanced-api

Balanced API specification.
221 stars 72 forks source link

v1.1 webhook receives account.created instead of customer.created; customer.created not documented #665

Open jonez734 opened 10 years ago

jonez734 commented 10 years ago

When I create a customer via the API, I get an event with type "account.created" instead of "customer.created". Also, customer.created (etc) are not documented.

mjallday commented 10 years ago

This does appear to be a legitimate bug.

I tried recreating the issue and here's the payload I received:

{
  "events": [
    {
      "links": {},
      "occurred_at": "2014-07-24T17:32:32.722000Z",
      "uri": "/events/EV7e5c6b18135811e4aaeb02e66206bf80",
      "entity": {
        "customers": [
          {
            "name": "Bob McTavish",
            "links": {
              "source": null,
              "destination": null
            },
            "created_at": "2014-07-24T17:32:32.598789Z",
            "updated_at": "2014-07-24T17:32:32.722140Z",
            "dob_month": null,
            "phone": null,
            "href": "/customers/CU3Qr7jULEcY5GUseEQltvpe",
            "meta": {},
            "dob_year": null,
            "email": null,
            "address": {
              "city": null,
              "line2": null,
              "line1": null,
              "state": null,
              "postal_code": null,
              "country_code": null
            },
            "id": "CU3Qr7jULEcY5GUseEQltvpe",
            "business_name": null,
            "ssn_last4": null,
            "merchant_status": "no-match",
            "ein": null
          }
        ],
        "links": {
          "customers.source": "/resources/{customers.source}",
          "customers.card_holds": "/customers/{customers.id}/card_holds",
          "customers.bank_accounts": "/customers/{customers.id}/bank_accounts",
          "customers.debits": "/customers/{customers.id}/debits",
          "customers.destination": "/resources/{customers.destination}",
          "customers.external_accounts": "/customers/{customers.id}/external_accounts",
          "customers.cards": "/customers/{customers.id}/cards",
          "customers.disputes": "/customers/{customers.id}/disputes",
          "customers.transactions": "/customers/{customers.id}/transactions",
          "customers.refunds": "/customers/{customers.id}/refunds",
          "customers.reversals": "/customers/{customers.id}/reversals",
          "customers.orders": "/customers/{customers.id}/orders",
          "customers.credits": "/customers/{customers.id}/credits"
        }
      },
      "href": "/events/EV7e5c6b18135811e4aaeb02e66206bf80",
      "type": "account.created",
      "id": "EV7e5c6b18135811e4aaeb02e66206bf80"
    }
  ],
  "links": {}
}

Here's an example to reproduce this scenario.