code: def create_debit():
      
      currency = request.jws_payload['data'].get('currency')
      amount = Amount("%s %s" % (request.jws_payload['data'].get('amount'),
                                 currency))
      address = request.jws_payload['data'].get('address')
      network = request.jws_payload['data'].get('network')
      reference = request.jws_payload['data'].get('reference')
      state = 'unconfirmed'
      try:
          debit = plugin.create_debit(current_user, amount, currency, address, network, reference, state='unconfirmed',
                                      plugins=ps, session=ses)
          plugin.process_debit(debit, plugins=ps, session=ses)
      except (IOError, ValueError) as e:
          current_app.logger.exception(e)
          ses.rollback()
          ses.flush()
          return "Unable to send money", 400
      except Exception as e:
          current_app.logger.exception(e)
          ses.rollback()
          ses.flush()
          return "Unable to send money", 500
      result = json.loads(jsonify2(debit, 'Debit'))
      current_app.logger.info("created new debit %s" % result)
      ses.close()
      return current_app.bitjws.create_response(result)
docs: Create a new debit, sending tokens out of your User's account.
      ---
      parameters:
        - name: debit
          in: body
          description: The debit you would like to create.
          required: true
          schema:
            $ref: '#/definitions/Debit'
      responses:
        '200':
          description: The Debit record
          schema:
            $ref: '#/definitions/Debit'
        default:
          description: unexpected error
          schema:
            $ref: '#/definitions/errorModel'
      security:
        - kid: []
        - typ: []
        - alg: []
      operationId: sendMoney