- POST /purses/$PURSE_PUB/merge#
Merge purse with account, adding the value of the purse into the account. Endpoint to be used by the receiver of a PUSH payment.
Request:
The request body must be a MergeRequest object.
Response:
- 200 OK:
The operation succeeded, the exchange confirms that the funds were merged into the account. The response will include a MergeSuccess object.
- 402 Payment Required:
The purse is not yet full and more money needs to be deposited before the merge can be made.
- 403 Forbidden:
The signature of the merge request or the reserve was invalid. This response comes with a standard ErrorDetail response.
- 404 Not found:
The merge operation failed as we could not find the purse or the partner exchange. This response comes with a standard ErrorDetail response.
- 409 Conflict:
The purse was already merged into a different reserve. The response will include a MergeConflict object.
- 410 Gone:
The purse has already expired and thus can no longer be merged. This response comes with a standard ErrorDetail response.
- 451 Unavailable For Legal Reasons:
This account has not yet passed the KYC checks. The client must pass KYC checks before proceeding with the merge. The response will be an LegitimizationNeededResponse object.
Details:
interface MergeRequest { // Normalized payto URI of the account the purse is to be merged into. // Must be of the form: 'payto://taler/$EXCHANGE_URL/$RESERVE_PUB'. payto_uri: string; // EdDSA signature of the account/reserve affirming the merge // over a TALER_AccountMergeSignaturePS. // Must be of purpose TALER_SIGNATURE_ACCOUNT_MERGE reserve_sig: EddsaSignature; // EdDSA signature of the merge private key affirming the merge // over a TALER_PurseMergeSignaturePS. // Must be of purpose TALER_SIGNATURE_PURSE_MERGE. merge_sig: EddsaSignature; // Client-side timestamp of when the merge request was made. merge_timestamp: Timestamp; }
interface MergeSuccess { // Amount merged (excluding deposit fees). merge_amount: Amount; // Time at which the merge came into effect. // Maximum of the "payment_timestamp" and the // "merge_timestamp". exchange_timestamp: Timestamp; // EdDSA signature of the exchange affirming the merge of // purpose TALER_SIGNATURE_PURSE_MERGE_SUCCESS // over TALER_PurseMergeSuccessSignaturePS. // Signs over the above and the account public key. exchange_sig: EddsaSignature; // public key used to create the signature. exchange_pub: EddsaPublicKey; }
interface MergeConflict { // Client-side timestamp of when the merge request was made. merge_timestamp: Timestamp; // EdDSA signature of the purse private key affirming the merge // over a TALER_PurseMergeSignaturePS. // Must be of purpose TALER_SIGNATURE_PURSE_MERGE. merge_sig: EddsaSignature; // Base URL of the exchange receiving the payment, only present // if the exchange hosting the reserve is not this exchange. partner_url?: string; // Public key of the reserve that the purse was merged into. reserve_pub: EddsaPublicKey; }