# 19. The release_reservation method¶

If a reservation is no longer required, and will not be purchased, then it may be released using this method. Reservations will be released automatically after a certain time period, but this method can be used to pre-empt this if a transaction is explicitly rejected. The naming of the method is somewhat inaccurate, however, as a successful return merely indicates that the order is no longer reserved. If this method is called on a purchased transaction then no action will be taken and a successful result will be returned. Similarly if it is called on a transaction which has already been released. A failure from this method is highly unlikely and will indicate some kind of problem with the underlying infrastructure.

## 19.1. Required inputs¶

The only required input is the “crypto_block” generated by “make_reservation”.

### 19.1.1. Example input¶

<release_reservation>
<user_id>demo</user_id>
<crypto_block>U4--BSro8S0HG3xBzCMFTcex-Pga_4Lq6ovGfmwjM5zN8vcYU
QEL6iX_nPn29FvBUAyCFf_DFP1JopqaSaH7v4kaGdwLQOD--hMnwmgP1ckwncRj
qSQ2I4Qq3B9JmGSbjY7GEwwQ2lmATJbpHdKB0jL-AQfoS_BBjujD5-2yiJ2J7Sw
Z9kSAsELH2JCUOJddkrb6MZntCcFrdeLJYJCCFV4MK1t3xj80CzdafdJZCnBwr6
d7x2MZWdA85i4sRGpq3_z3oSv5w8FZI-yc6JuiBrWV-asiRbt8qN_vkqatZKuEz
ZdVOCFM_2QFvuPcwpOaME7h2Itl8NCPiWmrAEg0MBZ41pazEMHPdz1xnGnM4LEq
UzUhrOdf76N2zYsUvBjhamq5qSK5s5iztdoNT__aHN0ctF8DyuhaEzpxuqO82Zl
wBMUTud3ZCnYPxQFP7AoaQTA7Evxtt6rEfgRd3qSnEoWcK4egauQccXS1hKa30x
NLA0x_TDODXYD-F8sIf3Q07XqbIAm7_910C-srJ_kLx_nSvg9hgLdsQ2uztGY-w
T4M9m9-Z</crypto_block>
</release_reservation>


## 19.2. Output data¶

The output consists of a single element named “released_ok” which contains either a “yes” or “no”. A “yes” value indicates that the transaction is guaranteed to no longer be on reserve. A “no” value indicates that the operation could not be performed, though it may be re-attempted at a later time.

### 19.2.1. Example output¶

<release_reservation_result>
<released_ok>yes</released_ok>
</release_reservation_result>


## 19.3. Potential failure codes¶

• 1 - the supplied crypto block was not generated by
“make_reservation”
• 2 - the requested “mime_text_type” was not a supported value