{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/v3/orders/reserve","auth":"required","method":"post","examples":{"codes":[{"language":"curl","code":"curl -X POST \\\n  API_URL/v3/orders/reserve \\\n  -H 'Authorization: Bearer WYRE_SECRET_KEY' \\\n  -H 'Content-Type: application/json' \\\n  -H 'Postman-Token: 7ad1cd47-a7bc-4126-9333-4983f4c6da5d' \\\n  -H 'cache-control: no-cache' \\\n  -d '{\n\t    \"amount\": \"10\", // always the fiat source Amount without fees\n\t    \"sourceCurrency\": \"EUR\",\n\t    \"destCurrency\": \"ETH\",\n\t    \"referrerAccountId\": \"AAAAAA_CC\",\n\t\t\t\"email\": \"user:::at:::sendwyre.com\",\n\t    \"dest\": \"ethereum:0x9E01E0E60dF079136a7a1d4ed97d709D5Fe3e341\",\n\t    \"firstName\": \"\",\n\t    \"city\": \"\",\n\t    \"phone\": \"+1111111111\",\n\t    \"street1\": \"\",\n\t    \"country\": \"\", // alpoha 2 country code  \n      \"redirectUrl\": \"https://google.com\",\n      \"failureRedirectUrl\": \"https://google.com\",\n      \"paymentMethod\": \"debit-card\",        \n\t    \"state\": \"\", // state code\t\n\t    \"postalCode\": \"\", \n\t    \"lastName\": \"\",\n\t    \"lockFields\": [\n\t\t\t\"amount\"...\n\t    ]\n\t}'"},{"code":"const axios = require('axios');\nconst testUrl = \"https://api.testwyre.com\";\nconst productionUrl = \"https://api.sendwyre.com\";\nconst WYRE_TEST_API_KEY = \"AK-xxxx-xxxx-xxxx\";\n\n// Example is assuming use of Express and Axios\n// Make sure you are using the proper API keys for the correct environment (test, prod).\nasync orderReservation(req, res, next) {\n        try {\n            const timestamp = new Date().getTime();\n            const url = `${testUrl}/v3/orders/reserve?timestamp=${timestamp}`;\n            const headers = {};\n            const body = {\n              referrerAccountId: req.body.referrerAccountId\n            }\n            const details = JSON.stringify(body);\n            headers['Content-Type'] = 'application/json';\n            headers['X-Api-Key'] = WYRE_TEST_API_KEY;\n            headers['X-Api-Signature'] = signature(url, details);\n            const config = {\n                method: \"POST\",\n                url: url,\n                headers: headers,\n                data: details\n            }\n            const response = await axios(config);\n            res.send(response.data);\n        } catch (error) {\n            next(error)\n        }\n    }\n\n//View signature example here: https://dash.readme.com/legacy/project/wyre-beta/v3/docs/authentication","language":"javascript"}]},"results":{"codes":[{"name":"","code":"{\n  \"url\":\"https://pay.testwyre.com/purchase?reservation=6J23WGVGTJZRNTX7D949&accountId=AC_FOOD&amount=10&sourceCurrency=USD&destCurrency=BTC\",\n  \"reservation\":\"6J23WGVGTJZRNTX7D949\"\n}","language":"json","status":200}]},"settings":"","params":[{"name":"amount","type":"string","default":"","desc":"[optional] Locks the order amount","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e2"},{"name":"sourceCurrency","type":"string","default":"","desc":"[optional] Locks the source currency to the supplied","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e1"},{"name":"destCurrency","type":"string","default":"","desc":"[optional] Locks the destination currency to the supplied","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e0"},{"name":"dest","type":"string","default":"","desc":"[optional] Locks the funds destination for this order","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073df"},{"name":"firstName","type":"string","default":"","desc":"[optional] buyer's first name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b9"},{"name":"lastName","type":"string","default":"","desc":"[optional] buyer's last name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b8"},{"name":"phone","type":"string","default":"","desc":"[optional] a valid us phone number","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b7"},{"name":"email","type":"string","default":"","desc":"[optional] a valid email address","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b6"},{"name":"country","type":"string","default":"US","desc":"[optional] Country code (alpha2 country code)","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b5"},{"name":"postalCode","type":"string","default":"","desc":"[optional] valid us zipcode","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b4"},{"name":"state","type":"string","default":"","desc":"[optional]  a valid us state code, it must be two uppercase letter. Ex CA","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b3"},{"name":"city","type":"string","default":"","desc":"[optional] city name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b2"},{"name":"street1","type":"string","default":"","desc":"[optional] valid street line","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b1"},{"name":"lockFields","type":"array_string","default":"[]","desc":"","required":false,"in":"body","ref":"","_id":"5f08b0f95418de02b537aa0f"},{"name":"redirectUrl","type":"string","default":"","desc":"[optional] if present, must be a valid url with http procotol","required":false,"in":"body","ref":"","_id":"5f0cb2d0e05dea005703a5cb"},{"name":"failureRedirectUrl","type":"string","default":"","desc":"[optional] if present, must be a valid url with http protocol","required":false,"in":"body","ref":"","_id":"5f0cb2d0e05dea005703a5ca"},{"name":"paymentMethod","type":"string","default":"","desc":"[optional] accepted values are: apple-pay. or debit-card","required":false,"in":"body","ref":"","_id":"5f0cb2d0e05dea005703a5c9"},{"name":"referrerAccountId","type":"string","default":"","desc":"your account id (account owner of the bearer token)","required":false,"in":"body","ref":"","_id":"5f2816a0220559020321ce6c"},{"name":"referenceId","type":"string","default":"","desc":"[optional] your own reference id","required":false,"in":"body","ref":"","_id":"5f40165fb3e73d069839f244"},{"name":"hideTrackBtn","type":"boolean","default":"[optional] false","desc":"to disable the track button at the complete page","required":false,"in":"body","ref":"","_id":"5f7e285ed8732c0061366b24"}]},"next":{"description":"","pages":[]},"title":"Wallet Order Reservations","type":"endpoint","slug":"wallet-order-reservations","excerpt":"Lock in wallet order via API before allowing widget operation","body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"body\": \"Mandatory Enforcement of Wallet Order Reservations\\nStarting on July 14th, 2020 Test Wyre (Wyre's Test Environment) will be enforcing Wallet Order Reservations (WORs) for all Widget Processing. You must reach out to a Wyre team member through our Discord or by email ([email protected]) to continue testing with the widget successfully. Please provide your test account ID (AC_1234ABCDE) so we can enable this feature.\\n\\nOn August 3rd, 2020 WORs will be enforced for all use of the Widget on production. You will need an approved business account with Wyre to continue using the Widget. This will effectively break any integration that has not completed account verification and has had our team enable the WOR feature on their account. Please get in contact with the Wyre team if you have questions regarding this.\",\n  \"title\": \"Mandatory Enforcement of Wallet Order Reservations\"\n}\n[/block]\n\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"All Fields Are Optional to Generate the Wallet Order Reservation\",\n  \"body\": \"When generating Wallet Order Reservations after the enforcement on August 3rd all fields will be optional. You will only need an approved production Wyre account to generate the WORs. If you do not have an approved account they will fail automatically.\"\n}\n[/block]\n\nUse this authenticated API endpoint to create a reservation ID for a wallet order. This allows you to lock in the details for the order in an immutable way from your server before presenting the Wyre widget to the customer. \n\nThis call requires API authentication and specially granted permission, ask our OPS team. Your account will be used as the enforced `accountId` on the subsequently created orders.\n\nThe generated reservation wallet order ID may only be used once. If the order fails, the ID will become unusable. Any callbacks issued on behalf of the order will use the same order ID, so it can be useful for correlating Wyre order to data in your own database. Reservations are good for **one hour**.\n\nAll the parameters are optional except (amount and sourceCurrency, both are required when one of them are locked). \n\n`country`: must be the alpha2 code (2 characters) in uppercase. \n`referrerAccountId`: must be the owner of the authentication. \n`lockFields` are fields names that will be locked and will reject the order if the user changes their values. A locked field cannot be changed by the user. \nPossible values for lockFields are [\"amount\", \"sourceCurrency\", \"destCurrency\", \"dest\", \"street1\", \"city\", \"state\", \"postalCode\", \"country\", \"firstName\", \"lastName\", \"phone\", \"email\"]. Locked fields are validated (ex, email must be valid to be locked). \n`sourceCurrency`  possible values are USD, GBP, EUR, CAD, AUD. \n`paymentMethod` possible values are `debit-card`, `apple-pay`. When specified, it cannot be changed by the user.\n`redirectUrl`: Any valid HTTP URL to redirect the user when payment finishes (success case). \n`failureRedirectUrl`: Any valid HTTP URL to redirect the user when payment finishes (error case). \n`phone`: Must be a valid phone in the [E.164](https://en.wikipedia.org/wiki/E.164) format. \n\n\nThrough Wyre [support](https://support.sendwyre.com), you may request that your account have such reservations enforced. Reservations may be used by all accounts by default, but are not enforced until requested. Without enforcement, a user may modify the URL and omit the reservation ID, allowing them to perform an arbitrarily sized transaction. With enforcement enabled, all orders will fail that do not match an existing reservation.\n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Test Data\",\n  \"body\": \"You should supply your own test dummy data. Do not use the ones in the samples.\"\n}\n[/block]","updates":["5e5136765249ac0055b77464"],"order":7,"isReference":true,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5df1ebd9f7bd6502401073dd","project":"550f74bb6fc8130d0038aad3","version":{"version":"3","version_clean":"3.0.0","codename":"","is_stable":true,"is_beta":true,"is_hidden":false,"is_deprecated":false,"categories":["550f75de61d9d30d00af9e02","551027e38579861900a86698","551029e08579861900a8669a","551029e7498062190006328a","5bc633a722d682005c9ad9e4","5bc633b08c4b0b000d6a7eaa","5bc633b48f3ff600626e3e18","5bc63538e5a6ba000d22ee6d","5bc63587a18a6b000decd295","5bc635c0937fcb0056223d9c","5bc6360f42f41800319aeaa6","5be5d13ff1d319002baca9ce","5be5d2287cd14d00291fbfdb","5be8b3b09f7cb70023c56a39","5be8b3cbb910100044e20206","5c1d769a4f6aed001fe527f0","5c402942010f0d001496dded","5e8127d61c906800374eeb1c","5f2768c98622b8005106544a","5f2768d05702ca0011f7655e","5f276e5348d2b600321aef9b","5f276fd300e519001139200a"],"_id":"550f75de61d9d30d00af9e01","__v":22,"releaseDate":"2015-03-23T02:09:34.221Z","project":"550f74bb6fc8130d0038aad3","createdAt":"2015-03-23T02:09:34.221Z","forked_from":"550f74bb6fc8130d0038aad6"},"category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Wyre Checkout","slug":"wyre-sdk","order":2,"from_sync":false,"reference":true,"_id":"5bc63538e5a6ba000d22ee6d","project":"550f74bb6fc8130d0038aad3","version":"550f75de61d9d30d00af9e01","createdAt":"2018-10-16T19:00:08.331Z","__v":1},"user":"54eb8076867e1917009b7160","createdAt":"2019-12-12T07:27:21.451Z","__v":35,"parentDoc":null}

postWallet Order Reservations

Lock in wallet order via API before allowing widget operation

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

amount:
string
[optional] Locks the order amount
sourceCurrency:
string
[optional] Locks the source currency to the supplied
destCurrency:
string
[optional] Locks the destination currency to the supplied
dest:
string
[optional] Locks the funds destination for this order
firstName:
string
[optional] buyer's first name
lastName:
string
[optional] buyer's last name
phone:
string
[optional] a valid us phone number
email:
string
[optional] a valid email address
country:
stringUS
[optional] Country code (alpha2 country code)
postalCode:
string
[optional] valid us zipcode
state:
string
[optional] a valid us state code, it must be two uppercase letter. Ex CA
city:
string
[optional] city name
street1:
string
[optional] valid street line
lockFields:
array of strings[]
redirectUrl:
string
[optional] if present, must be a valid url with http procotol
failureRedirectUrl:
string
[optional] if present, must be a valid url with http protocol
paymentMethod:
string
[optional] accepted values are: apple-pay. or debit-card
referrerAccountId:
string
your account id (account owner of the bearer token)
referenceId:
string
[optional] your own reference id
hideTrackBtn:
boolean[optional] false
to disable the track button at the complete page

Examples


Result Format


Documentation

[block:callout] { "type": "danger", "body": "Mandatory Enforcement of Wallet Order Reservations\nStarting on July 14th, 2020 Test Wyre (Wyre's Test Environment) will be enforcing Wallet Order Reservations (WORs) for all Widget Processing. You must reach out to a Wyre team member through our Discord or by email ([email protected]) to continue testing with the widget successfully. Please provide your test account ID (AC_1234ABCDE) so we can enable this feature.\n\nOn August 3rd, 2020 WORs will be enforced for all use of the Widget on production. You will need an approved business account with Wyre to continue using the Widget. This will effectively break any integration that has not completed account verification and has had our team enable the WOR feature on their account. Please get in contact with the Wyre team if you have questions regarding this.", "title": "Mandatory Enforcement of Wallet Order Reservations" } [/block] [block:callout] { "type": "warning", "title": "All Fields Are Optional to Generate the Wallet Order Reservation", "body": "When generating Wallet Order Reservations after the enforcement on August 3rd all fields will be optional. You will only need an approved production Wyre account to generate the WORs. If you do not have an approved account they will fail automatically." } [/block] Use this authenticated API endpoint to create a reservation ID for a wallet order. This allows you to lock in the details for the order in an immutable way from your server before presenting the Wyre widget to the customer. This call requires API authentication and specially granted permission, ask our OPS team. Your account will be used as the enforced `accountId` on the subsequently created orders. The generated reservation wallet order ID may only be used once. If the order fails, the ID will become unusable. Any callbacks issued on behalf of the order will use the same order ID, so it can be useful for correlating Wyre order to data in your own database. Reservations are good for **one hour**. All the parameters are optional except (amount and sourceCurrency, both are required when one of them are locked). `country`: must be the alpha2 code (2 characters) in uppercase. `referrerAccountId`: must be the owner of the authentication. `lockFields` are fields names that will be locked and will reject the order if the user changes their values. A locked field cannot be changed by the user. Possible values for lockFields are ["amount", "sourceCurrency", "destCurrency", "dest", "street1", "city", "state", "postalCode", "country", "firstName", "lastName", "phone", "email"]. Locked fields are validated (ex, email must be valid to be locked). `sourceCurrency` possible values are USD, GBP, EUR, CAD, AUD. `paymentMethod` possible values are `debit-card`, `apple-pay`. When specified, it cannot be changed by the user. `redirectUrl`: Any valid HTTP URL to redirect the user when payment finishes (success case). `failureRedirectUrl`: Any valid HTTP URL to redirect the user when payment finishes (error case). `phone`: Must be a valid phone in the [E.164](https://en.wikipedia.org/wiki/E.164) format. Through Wyre [support](https://support.sendwyre.com), you may request that your account have such reservations enforced. Reservations may be used by all accounts by default, but are not enforced until requested. Without enforcement, a user may modify the URL and omit the reservation ID, allowing them to perform an arbitrarily sized transaction. With enforcement enabled, all orders will fail that do not match an existing reservation. [block:callout] { "type": "warning", "title": "Test Data", "body": "You should supply your own test dummy data. Do not use the ones in the samples." } [/block]