Get one to ten debit(s) for a single User.
    ---
    parameters:
      - name: searchcd
        in: body
        description: The Debit(s) you'd like to get.
        required: false
        schema:
          $ref: '#/definitions/SearchCD'
    responses:
      '200':
        description: the User's debit(s)
        schema:
          items:
            $ref: '#/definitions/Debit'
          type: array
      default:
        description: unexpected error
        schema:
          $ref: '#/definitions/errorModel'
    security:
      - kid: []
      - typ: []
      - alg: []
    operationId: searchDebits

def search_debit():
    """
    Get one to ten debit(s) for a single User.
    ---
    parameters:
      - name: searchcd
        in: body
        description: The Debit(s) you'd like to get.
        required: false
        schema:
          $ref: '#/definitions/SearchCD'
    responses:
      '200':
        description: the User's debit(s)
        schema:
          items:
            $ref: '#/definitions/Debit'
          type: array
      default:
        description: unexpected error
        schema:
          $ref: '#/definitions/errorModel'
    security:
      - kid: []
      - typ: []
      - alg: []
    operationId: searchDebits
    """
    sid = request.jws_payload['data'].get('id')
    address = request.jws_payload['data'].get('address')
    currency = request.jws_payload['data'].get('currency')
    network = request.jws_payload['data'].get('network')
    #reference = request.jws_payload['data'].get('reference')
    ref_id = request.jws_payload['data'].get('ref_id')
    page = request.jws_payload['data'].get('page') or 0

    debsq = ses.query(wm.Debit).filter(wm.Debit.user_id == current_user.id)
    if not debsq:
        return None

    if sid:
        debsq = debsq.filter(wm.Debit.id == sid)
    if address:
        debsq = debsq.filter(wm.Debit.address == address)
    if currency:
        debsq = debsq.filter(wm.Debit.currency == currency)
    if network:
        debsq = debsq.filter(wm.Debit.network == network)
    #if reference:
    #    debsq = debsq.filter(wm.Debit.reference == reference)
    if ref_id:
        debsq = debsq.filter(wm.Debit.ref_id == ref_id)
    debsq = debsq.order_by(wm.Debit.time.desc()).limit(10)
    if page and isinstance(page, int):
        debsq = debsq.offset(page * 10)

    debits = [json.loads(jsonify2(d, 'Debit')) for d in debsq]
    response = current_app.bitjws.create_response(debits)
    ses.close()
    return response