Sending lodging data with the iframe

---
tags: [form, hospitality]
---

| Background                                                                                                                                                                                                                                                                                                                                                                                                               |
| :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Before starting this tutorial, make sure you understand the following topics from the [Quick start](doc:quick-start) section:                                                                                                                                                                                                                                                                                           |
| <ul style={{ marginTop: "-5px", marginBottom: "-5px" }}>                                                                                                                                                                                                                                                                                                                                                                |
| <li>[Sandbox environments](doc:sandbox-environments) (especially about testing).</li>                                                                                                                                                                                                                                                                                                                                   |
| <li>[Authentication](doc:authentication) (about authenticating using your API user and when you need a login versus a one-time-use token).</li>                                                                                                                                                                                                                                                                          |
| </ul>                                                                                                                                                                                                                                                                                                                                                                                                                   |

Merchants in the lodging industry can pass certain parameters.

Only card-based requests are allowed, but you can use both the ecommerce or retail flows for terminal or remote.

The entire lodging object is optional. However, the following are all the supported parameters:

* Advanced Deposit (`lodging.advanceDeposit`)
* Check-in Date (`lodging.checkInDate`)
* Check-out Date (`lodging.checkOutDate`)
* No Show (`lodging.noShow`)
* Room Number (`lodging.roomNumber`)
* Room Rate (`lodging.roomRate`)
* Folio Number (`customer.orderNumber`)

1. **Prepare the Iframe**

   Follow **steps 1-2** of the [Creating a card checkout page with the iframe](doc:creating-a-card-checkout-page-with-the-iframe) tutorial.<br>

2. **Request a One-time-use Token**

   Request an e-commerce [one-time-use token](ref:createonetimeusetoken).

   Include the lodging object and the folio number in the body of your request.

   > πŸ“˜ Note
   >
   > Folio number must be sent in the `customer` object, labeled `orderNumber`.

   ```shell Example
   curl -X POST https://api.nexiopaysandbox.com/pay/v3/token \
     -H 'Content-Type: application/json' \
     -H 'Accept: application/json' \
     -H 'Authorization: Basic [Base64_encoded_login]'
     -d '{
     "data": {
       "amount": 29.99,
       "currency": "USD",
       "lodging": {
         "advanceDeposit": true,
         "checkInDate": "2018-12-31",
         "checkOutDate": "2019-01-05", 
         "roomNumber": 14, 
         "roomRate": 143.99
       },
       "customer": {
         "orderNumber": 4566
       }
     }
   }'

  1. Load the Iframe

    Follow steps 4-6 of the Creating a card checkout page with the iframe tutorial.