post-accounts-USERNAME-transactions.rst (2200B)
1 .. http:post:: /accounts/$USERNAME/transactions 2 3 Create a new transaction where the bank account with the label ``USERNAME`` is **debited**. 4 5 **Request:** 6 7 .. ts:def:: CreateTransactionRequest 8 9 interface CreateTransactionRequest { 10 // Address in the payto format of the wire transfer receiver. 11 // It needs at least the 'message' query string parameter. 12 payto_uri: string; 13 14 // Transaction amount (in the $currency:x.y format), optional. 15 // However, when not given, its value must occupy the 'amount' 16 // query string parameter of the 'payto' field. In case it 17 // is given in both places, the payto_uri's takes the precedence. 18 amount: string; 19 20 // Nonce to make the request idempotent. Requests with the same 21 // ``request_uid`` that differ in any of the other fields 22 // are rejected. 23 // @since **v4**, will become mandatory in the next version. 24 request_uid?: ShortHashCode; 25 } 26 27 **Response:** 28 29 :http:statuscode:`200 Ok`: 30 The bank responds with an `CreateTransactionResponse` object. 31 :http:statuscode:`202 Accepted`: 32 2FA is required for this operation. This returns the `ChallengeResponse` response. @since **v10** 33 :http:statuscode:`400 Bad Request`: 34 The request was invalid or the payto://-URI used unacceptable features. 35 :http:statuscode:`401 Unauthorized`: 36 Invalid or missing credentials. 37 :http:statuscode:`403 Forbidden`: 38 Missing rights. 39 :http:statuscode:`404 Not found`: 40 The account pointed by ``$USERNAME`` was not found. 41 :http:statuscode:`409 Conflict`: 42 * ``TALER_EC_BANK_SAME_ACCOUNT`` : creditor account is the same than ``USERNAME``. 43 * ``TALER_EC_BANK_UNKNOWN_CREDITOR`` : creditor account was not found. 44 * ``TALER_EC_BANK_UNALLOWED_DEBIT`` : the account does not have sufficient funds or the amount is too low or too high. 45 * ``TALER_EC_BANK_TRANSFER_REQUEST_UID_REUSED``: an operation with the same ``request_uid`` but different details has been submitted before. 46 47 **Details:** 48 49 .. ts:def:: CreateTransactionResponse 50 51 interface CreateTransactionResponse { 52 // ID identifying the transaction being created 53 row_id: Integer; 54 }