{"metadata":{"image":[],"title":"","description":""},"api":{"url":"/v3/debitcard/process/partner","auth":"required","method":"post","examples":{"codes":[{"language":"javascript","code":"curl -X POST \\\n  API_URL/v3/debitcard/process/partner \\\n  -H 'Authorization: Bearer WYRE_SECRET_KEY' \\\n  -H 'Content-Type: application/json' \\\n  -H 'cache-control: no-cache' \\\n  -d '{\n   \"debitCard\":{\n      \"number\":\"4111111111111111\",\n      \"year\":\"2023\",\n      \"month\":\"01\",\n      \"cvv\":\"123\"\n   },\n   \"reservationId\":\"\",\n   \"amount\":\"10\",\n   \"sourceCurrency\":\"USD\",\n   \"destCurrency\":\"BTC\",\n   \"dest\":\"bitcoin:tb1q6yn0ajs733xsk25vefrhwjey4629qt9c67y6ma\",\n   \"referrerAccountId\":\"AC_CVZ4AYV8CN8\", \n   \"givenName\":\"\",\n   \"familyName\":\"\",\n   \"email\":\"test.wyre:::at:::sendwyre.com\",\n   \"phone\":\"+14151234567\",\n    \"referenceId\": \"your_business_id\",\n   \"address\":{\n      \"street1\":\"\",\n      \"city\":\"\",\n      \"state\":\"\", // state code\n      \"postalCode\":\"\", // only numbers\n      \"country\":\"\"// alpha2 country code\n   }\n}'","name":"curl"}]},"results":{"codes":[{"name":"","code":"{\n    \"id\": \"WO_ELTUVYCAFPG\", --> waller order id\n    \"createdAt\": 1576263687643,  -- timestamp in UTC\n    \"owner\": \"account:AC_RNWQNRAZFPC\",\n    \"status\": \"PROCESSING\",\n    \"transferId\": \"TF_MDA6MAY848D\",\n    \"sourceAmount\": 1.84,\n    \"sourceCurrency\": \"USD\",\n    \"destCurrency\": \"ETH\",\n    \"dest\": \"ethereum:0x9E01E0E60dF079136a7a1d4ed97d709D5Fe3e341\",\n    \"walletType\": \"APPLE_PAY\",\n    \"transferId\": null,\n    \"email\": \"[email protected]\",\n    \"errorMessage\": null,\n    \"accountId\": \"AC_RNWQNRAZFPC\",\n    \"paymentMethodName\": \"Visa 2942\"\n}","language":"json","status":200}]},"settings":"","params":[{"name":"amount","type":"string","default":"","desc":"the order amount","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e2"},{"name":"sourceCurrency","type":"string","default":"","desc":"the source currency to the supplied, valid values are USD, CAD, EUR, GBP and AUD","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e1"},{"name":"destCurrency","type":"string","default":"","desc":"the destination currency to the supplied","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073e0"},{"name":"dest","type":"string","default":"","desc":"the funds destination for this order","required":false,"in":"body","ref":"","_id":"5df1ebd9f7bd6502401073df"},{"name":"givenName","type":"string","default":"","desc":"buyer's first name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b9"},{"name":"familyName","type":"string","default":"","desc":"buyer's last name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b8"},{"name":"phone","type":"string","default":"","desc":"a valid phone number in the E.164 format E.g +14151234567.  Must match your address country.","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b7"},{"name":"email","type":"string","default":"","desc":"a valid email address","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b6"},{"name":"address.country","type":"string","default":"","desc":"Country code (alpha2 country code)","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b5"},{"name":"address.postalCode","type":"string","default":"","desc":"valid us zipcode","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b4"},{"name":"address.state","type":"string","default":"","desc":"a valid state code, it must be two uppercase letter. Ex CA","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b3"},{"name":"address.city","type":"string","default":"","desc":"city name","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b2"},{"name":"address.street1","type":"string","default":"","desc":"valid street line","required":false,"in":"body","ref":"","_id":"5e1e2fa8b407260011f2b4b1"},{"name":"referrerAccountId","type":"string","default":"","desc":"Partner account id, must match the account id that created the reservation","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428ef"},{"name":"reservationId","type":"string","default":"","desc":"A valid reservation id","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428ee"},{"name":"debitCard.number","type":"string","default":"","desc":"debit card number","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428ed"},{"name":"debitCard.year","type":"string","default":"","desc":"expiration year with 4 digits","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428ec"},{"name":"debitCard.month","type":"string","default":"","desc":"2 digits month 00-12 (must be 2 digits, add 0 prefix if needed)","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428eb"},{"name":"debitCard.cvv","type":"string","default":"","desc":"valid card cvv","required":false,"in":"body","ref":"","_id":"5f1a03a33a5bdc001e7428ea"},{"name":"referenceId","type":"string","default":"","desc":"[optional] your own business reference id","required":false,"in":"body","ref":"","_id":"5f46b8bd2480250d45af8a87"},{"name":"ipAddress","type":"string","default":"","desc":"End user's ip address","required":false,"in":"body","ref":"","_id":"6064cec5675ea5000f5c4c81"}]},"next":{"description":"","pages":[]},"title":"Card Processing","type":"endpoint","slug":"white-label-card-processing-api","excerpt":"Accept card payments using Wyre's API","body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Contact [email protected] to enable this feature.\",\n  \"body\": \"Please reach out to the sales team to enable this feature within your account.\"\n}\n[/block]\nIf you would like to build your custom checkout flow using the API, but keep your PCI compliance requirements limited to the minimal level, Wyre's Card Processing API is the ideal solution. Like all of our cards products, Wyre only supports Debit Cards from MasterCard and Visa at the moment. If you'd like Credit Card supported, please reach out to our sales team at [email protected] \n[block:callout]\n{\n  \"type\": \"info\",\n  \"title\": \"Breaking changes - End-user IP Address\",\n  \"body\": \"Starting on **March 30th**, Wyre started requesting the end user's IP address. You have up to **May 30th** to adjust your Card Processing integration and start sending the new property `**ipAddress**` with the normal Wallet Order Request. \\nThis is a mandatory field and it **must** be the real IP address from the end-user. Do not send your server's IP address or all your traffic is gonna be blocked. \\n\\nNoth IPv4 and IPv6 are accepted.\"\n}\n[/block]\nThe following is a guide on how you're able to use the Card Processing API to accept payments within your application.\n\n## 1.) CREATE WALLET ORDER RESERVATION\n\nAfter getting all set up, you'll need to create a **Wallet Order 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 taking in payment details. \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. Learn more about [Wallet Order Reservations](doc:wallet-order-reservations).\n\n## 2.) CREATE WALLET ORDER\nUse the code example (top of the page) to process the payment with the [Card Processing API](doc:white-label-card-processing-api).\n\nUse the returned `reservation` from step #1 as the `reservationId` param for card processing.\n\n## 4.) GET ORDER ID and AUTH CODES\nAfter you've created the order, you will receive the `id` of the order in the response. Also note the `status` and `authCodesRequested` parameters. \n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"id\\\":\\\"WO_PQAG8JHTA2F\\\",\\n   \\\"createdAt\\\":1595539060000,\\n   \\\"owner\\\":\\\"account:AC_RW4FHEJPCHW\\\",\\n   \\\"status\\\":\\\"RUNNING_CHECKS\\\",\\n   \\\"orderType\\\":\\\"INTERNATIONAL\\\",\\n   \\\"sourceAmount\\\":10.0,\\n   \\\"purchaseAmount\\\":9.31,\\n   \\\"sourceCurrency\\\":\\\"USD\\\",\\n   \\\"destCurrency\\\":\\\"BTC\\\",\\n   \\\"transferId\\\":null,\\n   \\\"dest\\\":\\\"bitcoin:tb1q6yn0ajs733xsk25vefrhwjey4629qt9c67y6ma\\\",\\n   \\\"email\\\":\\\"[email protected]\\\",\\n   \\\"authCodesRequested\\\":false,\\n   \\\"paymentMethodName\\\":\\\"Visa ending 1111\\\",\\n   \\\"accountId\\\":\\\"AC_RW4FHEJPCHW\\\"\\n}\",\n      \"language\": \"json\"\n    }\n  ]\n}\n[/block]\n## 5.) AUTHENTICATION CODES STATUS\n\nWhile the order status = `RUNNING_CHECKS`, poll the [Card Authorize](doc:authorize-card) endpoint to determine if `authCodesRequested` is true. `authCodesRequested` may return `true` or `false`. \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"body\": \"When the wallet order status is different than RUNNING_CHECKS the [Card Authorize](doc:authorize-card) endpoint (smsNeeded and card2faNeeded) should be ignored.\",\n  \"title\": \"Auth Codes Checks\"\n}\n[/block]\n\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"walletOrderId\\\":\\\"WO_9PUXWLZD888\\\",\\n   \\\"smsNeeded\\\":true,\\n   \\\"card2faNeeded\\\":true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"GET v3/debitcard/authorization/:orderId response\"\n    }\n  ]\n}\n[/block]\n## 6.)  POSTING AUTHENTICATION CODES\nWyre requires two authentication codes if `authCodesRequested` is true :\n  * CARD2FA - A 6 digit code that's added immediately to the end user's bank account. This code is usually displayed under `Temporary Authorizations` in the user's bank or credit card account online.\n  * SMS - A 6 digit code sent to the user's mobile device. \n\nYou will need to confirm the codes that are requested. If the Authentication codes are not provided, the order will expire - the current expiration time is 10 minutes. When building your UI, you need to make it a real-time experience. \n\nThe GET request is only available until codes are still valid. After that, if you try to get authorization information in this endpoint we throw an error, check [Card Exceptions](doc:wallet-order-creation-exceptions)].  The current limit of attempts to specify the code is 5 times. After this, you will receive back an error and the order will expire.\n\nYou must provide the codes back in the following endpoint [Card Authorize](doc:authorize-card-sms-card2fa):\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n   \\\"type\\\":\\\"SMS\\\", \\n   \\\"walletOrderId\\\":\\\"WO_Y74E8FXVWJ2\\\",\\n   \\\"reservation\\\":\\\"NHEA3UYXEXCUX4Y2HG78\\\",\\n   \\\"sms\\\":\\\"000000\\\",\\n   \\\"card2fa\\\":\\\"000000\\\"\\n}\",\n      \"language\": \"json\",\n      \"name\": \"POST v3/debitcard/authorize/partner request\"\n    }\n  ]\n}\n[/block]\nThe node `type`  must be either `SMS`, `CARD2FA`  or `ALL`. When `SMS` the node `sms` is mandatory, when `CARD2FA`  the node `card2fa`  is mandatory,  when `ALL`  both `sms` and `card2fa` are mandatory. \n\nResponse\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"{\\n  \\\"walletOrderId\\\":\\\"WO_DX6B3UAVN8B\\\",\\n  \\\"success\\\":true\\n}\",\n      \"language\": \"json\",\n      \"name\": \"POST v3/debitcard/authorize response\"\n    }\n  ]\n}\n[/block]\nWhen any code failed due to any reason (max attempts, time expiration...) the order will also fail and card refunded. Failed orders cannot be resumed. These codes' needs might change at any time and based on the buyer's info. \n\n## 7.) VERIFY ORDER AUTHORIZATION\nKeep polling [Wallet Order Details](doc:wallet-order-details) until the order's status is `PROCESSING` or `COMPLETE`.\n\nThis is a publicly accessible endpoint:\nhttps://api.sendwyre.com/v3/orders/:orderId\n\nYou can also receive updates via Webhooks, contact our sales team at [email protected] to set up your webhook configuration. \n\n## 8.) TRACK WALLET ORDER\nOnce the `transferId` is returned it means the order was accepted and the transfer (blockchain transaction) is in progress. \n\nTo track its progress please check the transfer tracking documentation here: [Track Wallet Order](doc:track-wallet-order) \n[block:callout]\n{\n  \"type\": \"warning\",\n  \"title\": \"Test Data\",\n  \"body\": \"You should provide your own test dummy data. Do not use the data in the samples.\"\n}\n[/block]","updates":[],"order":3,"isReference":false,"hidden":false,"sync_unique":"","link_url":"","link_external":false,"_id":"5f19ed59ca78080045e330ac","createdAt":"2020-07-23T20:04:41.549Z","user":"5dcd9f0b28d74f003b86eca6","category":{"sync":{"isSync":false,"url":""},"pages":[],"title":"Card Processing","slug":"card-processing","order":4,"from_sync":false,"reference":false,"_id":"5f2768d05702ca0011f7655e","createdAt":"2020-08-03T01:30:56.397Z","version":"550f75de61d9d30d00af9e01","project":"550f74bb6fc8130d0038aad3","__v":0},"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","5f9a2cb79dafe500259281a7","5fd92bf362bb7301b00e48ba"],"_id":"550f75de61d9d30d00af9e01","__v":24,"releaseDate":"2015-03-23T02:09:34.221Z","project":"550f74bb6fc8130d0038aad3","createdAt":"2015-03-23T02:09:34.221Z","forked_from":"550f74bb6fc8130d0038aad6"},"project":"550f74bb6fc8130d0038aad3","__v":36,"parentDoc":null}

postCard Processing

Accept card payments using Wyre's API

Definition

{{ api_url }}{{ page_api_url }}

Parameters

Body Params

amount:
string
the order amount
sourceCurrency:
string
the source currency to the supplied, valid values are USD, CAD, EUR, GBP and AUD
destCurrency:
string
the destination currency to the supplied
dest:
string
the funds destination for this order
givenName:
string
buyer's first name
familyName:
string
buyer's last name
phone:
string
a valid phone number in the E.164 format E.g +14151234567. Must match your address country.
email:
string
a valid email address
address.country:
string
Country code (alpha2 country code)
address.postalCode:
string
valid us zipcode
address.state:
string
a valid state code, it must be two uppercase letter. Ex CA
address.city:
string
city name
address.street1:
string
valid street line
referrerAccountId:
string
Partner account id, must match the account id that created the reservation
reservationId:
string
A valid reservation id
debitCard.number:
string
debit card number
debitCard.year:
string
expiration year with 4 digits
debitCard.month:
string
2 digits month 00-12 (must be 2 digits, add 0 prefix if needed)
debitCard.cvv:
string
valid card cvv
referenceId:
string
[optional] your own business reference id
ipAddress:
string
End user's ip address

Examples


Result Format


Documentation

[block:callout] { "type": "danger", "title": "Contact [email protected] to enable this feature.", "body": "Please reach out to the sales team to enable this feature within your account." } [/block] If you would like to build your custom checkout flow using the API, but keep your PCI compliance requirements limited to the minimal level, Wyre's Card Processing API is the ideal solution. Like all of our cards products, Wyre only supports Debit Cards from MasterCard and Visa at the moment. If you'd like Credit Card supported, please reach out to our sales team at [email protected] [block:callout] { "type": "info", "title": "Breaking changes - End-user IP Address", "body": "Starting on **March 30th**, Wyre started requesting the end user's IP address. You have up to **May 30th** to adjust your Card Processing integration and start sending the new property `**ipAddress**` with the normal Wallet Order Request. \nThis is a mandatory field and it **must** be the real IP address from the end-user. Do not send your server's IP address or all your traffic is gonna be blocked. \n\nNoth IPv4 and IPv6 are accepted." } [/block] The following is a guide on how you're able to use the Card Processing API to accept payments within your application. ## 1.) CREATE WALLET ORDER RESERVATION After getting all set up, you'll need to create a **Wallet Order 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 taking in payment details. 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. Learn more about [Wallet Order Reservations](doc:wallet-order-reservations). ## 2.) CREATE WALLET ORDER Use the code example (top of the page) to process the payment with the [Card Processing API](doc:white-label-card-processing-api). Use the returned `reservation` from step #1 as the `reservationId` param for card processing. ## 4.) GET ORDER ID and AUTH CODES After you've created the order, you will receive the `id` of the order in the response. Also note the `status` and `authCodesRequested` parameters. [block:code] { "codes": [ { "code": "{\n \"id\":\"WO_PQAG8JHTA2F\",\n \"createdAt\":1595539060000,\n \"owner\":\"account:AC_RW4FHEJPCHW\",\n \"status\":\"RUNNING_CHECKS\",\n \"orderType\":\"INTERNATIONAL\",\n \"sourceAmount\":10.0,\n \"purchaseAmount\":9.31,\n \"sourceCurrency\":\"USD\",\n \"destCurrency\":\"BTC\",\n \"transferId\":null,\n \"dest\":\"bitcoin:tb1q6yn0ajs733xsk25vefrhwjey4629qt9c67y6ma\",\n \"email\":\"[email protected]\",\n \"authCodesRequested\":false,\n \"paymentMethodName\":\"Visa ending 1111\",\n \"accountId\":\"AC_RW4FHEJPCHW\"\n}", "language": "json" } ] } [/block] ## 5.) AUTHENTICATION CODES STATUS While the order status = `RUNNING_CHECKS`, poll the [Card Authorize](doc:authorize-card) endpoint to determine if `authCodesRequested` is true. `authCodesRequested` may return `true` or `false`. [block:callout] { "type": "warning", "body": "When the wallet order status is different than RUNNING_CHECKS the [Card Authorize](doc:authorize-card) endpoint (smsNeeded and card2faNeeded) should be ignored.", "title": "Auth Codes Checks" } [/block] [block:code] { "codes": [ { "code": "{\n \"walletOrderId\":\"WO_9PUXWLZD888\",\n \"smsNeeded\":true,\n \"card2faNeeded\":true\n}", "language": "json", "name": "GET v3/debitcard/authorization/:orderId response" } ] } [/block] ## 6.) POSTING AUTHENTICATION CODES Wyre requires two authentication codes if `authCodesRequested` is true : * CARD2FA - A 6 digit code that's added immediately to the end user's bank account. This code is usually displayed under `Temporary Authorizations` in the user's bank or credit card account online. * SMS - A 6 digit code sent to the user's mobile device. You will need to confirm the codes that are requested. If the Authentication codes are not provided, the order will expire - the current expiration time is 10 minutes. When building your UI, you need to make it a real-time experience. The GET request is only available until codes are still valid. After that, if you try to get authorization information in this endpoint we throw an error, check [Card Exceptions](doc:wallet-order-creation-exceptions)]. The current limit of attempts to specify the code is 5 times. After this, you will receive back an error and the order will expire. You must provide the codes back in the following endpoint [Card Authorize](doc:authorize-card-sms-card2fa): [block:code] { "codes": [ { "code": "{\n \"type\":\"SMS\", \n \"walletOrderId\":\"WO_Y74E8FXVWJ2\",\n \"reservation\":\"NHEA3UYXEXCUX4Y2HG78\",\n \"sms\":\"000000\",\n \"card2fa\":\"000000\"\n}", "language": "json", "name": "POST v3/debitcard/authorize/partner request" } ] } [/block] The node `type` must be either `SMS`, `CARD2FA` or `ALL`. When `SMS` the node `sms` is mandatory, when `CARD2FA` the node `card2fa` is mandatory, when `ALL` both `sms` and `card2fa` are mandatory. Response [block:code] { "codes": [ { "code": "{\n \"walletOrderId\":\"WO_DX6B3UAVN8B\",\n \"success\":true\n}", "language": "json", "name": "POST v3/debitcard/authorize response" } ] } [/block] When any code failed due to any reason (max attempts, time expiration...) the order will also fail and card refunded. Failed orders cannot be resumed. These codes' needs might change at any time and based on the buyer's info. ## 7.) VERIFY ORDER AUTHORIZATION Keep polling [Wallet Order Details](doc:wallet-order-details) until the order's status is `PROCESSING` or `COMPLETE`. This is a publicly accessible endpoint: https://api.sendwyre.com/v3/orders/:orderId You can also receive updates via Webhooks, contact our sales team at [email protected] to set up your webhook configuration. ## 8.) TRACK WALLET ORDER Once the `transferId` is returned it means the order was accepted and the transfer (blockchain transaction) is in progress. To track its progress please check the transfer tracking documentation here: [Track Wallet Order](doc:track-wallet-order) [block:callout] { "type": "warning", "title": "Test Data", "body": "You should provide your own test dummy data. Do not use the data in the samples." } [/block]