post-admin-add-incoming.rst (2282B)
1 .. http:post:: /admin/add-incoming 2 3 Simulate a transfer from a customer to the exchange. This API is *not* 4 idempotent since it's only used in testing. 5 6 **Request:** 7 8 .. ts:def:: AddIncomingRequest 9 10 interface AddIncomingRequest { 11 // Amount to transfer. 12 amount: Amount; 13 14 // Reserve public key that is included in the wire transfer details 15 // to identify the reserve that is being topped up. 16 reserve_pub: EddsaPublicKey; 17 18 // Account (as full payto URI) that makes the wire transfer to the exchange. 19 // Usually this account must be created by the test harness before this 20 // API is used. An exception is the "fakebank", where any debit account 21 // can be specified, as it is automatically created. 22 debit_account: string; 23 } 24 25 **Response:** 26 27 :http:statuscode:`200 OK`: 28 The request has been correctly handled, so the funds have been transferred to 29 the recipient's account. The body is a `AddIncomingResponse`. 30 :http:statuscode:`400 Bad request`: 31 The request is malformed. The bank replies with an `ErrorDetail` object. 32 :http:statuscode:`401 Unauthorized`: 33 Authentication failed, likely the credentials are wrong. 34 :http:statuscode:`404 Not found`: 35 The endpoint is wrong or the user name is unknown. The bank replies with an `ErrorDetail` object. 36 :http:statuscode:`409 Conflict`: 37 The 'reserve_pub' argument was used previously in another transfer, and the specification mandates that reserve public keys must not be reused. 38 39 **Details:** 40 41 .. ts:def:: AddIncomingResponse 42 43 interface AddIncomingResponse { 44 // Timestamp that indicates when the wire transfer will be executed. 45 // In cases where the wire transfer gateway is unable to know when 46 // the wire transfer will be executed, the time at which the request 47 // has been received and stored will be returned. 48 // The purpose of this field is for debugging (humans trying to find 49 // the transaction) as well as for taxation (determining which 50 // time period a transaction belongs to). 51 timestamp: Timestamp; 52 53 // Opaque ID of the wire transfer initiation performed by the bank. 54 // It is different from the /history endpoints row_id. 55 row_id: SafeUint64; 56 }