Skip to content
This repository has been archived by the owner on May 6, 2018. It is now read-only.

Remove credits from user account #1

Open
elimisteve opened this issue May 4, 2014 · 2 comments
Open

Remove credits from user account #1

elimisteve opened this issue May 4, 2014 · 2 comments
Assignees

Comments

@elimisteve
Copy link
Member

Accept POST to /currency/api/1/debit with the following JSON schema:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "id": "http://sbhx.co/currency/api/1/debit",
  "type": "object",
  "required": false,
  "properties": {
    "card_id": {
      "id": "http://sbhx.co/currency/api/1/debit/card_id#",
      "type": "string",
      "required": false
    },
    "amount_in_cents": {
      "id": "http://sbhx.co/currency/api/1/debit/amount_in_cents#",
      "type": "integer",
      "required": false
    }
  }
}
@elimisteve elimisteve added this to the Flask credit/debit app milestone May 4, 2014
@elimisteve elimisteve self-assigned this May 4, 2014
@elimisteve
Copy link
Member Author

Possible responses:

200: {"success": "Successfully charged. Remaining balance: $12.34"}
400: {"error": "Malformed request: (something more specific here)"}
402: {"error": "Insufficient funds. Please insert coin."}
403: {"error": "Bad signature/Not authorized"}
429: {"error": "Too many requests; slow down!"}

@elimisteve
Copy link
Member Author

Should also include an error when the wrong user is specified. What do you think, @gholms? 400? 404? I'm thinking 404.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant