Get Started

A quick introduction to building with Waivr

Let’s test out running Waivr locally by following the step-by-step integration process. You’ll need API keys, which you can request here. You'll have two different API keys, and there are two different Waivr environments. We'll start in the Stage environment.

API Token
Key icon
key
Private token identifier
Key icon
secret
Private secret associated to token

Environment
Code icon
Stage
Build your own integration platform to try Waivr API
Launch icon
Production
Launch and process payments


Setup

Once you have your API keys, you can try out our product. The instructions below will guide you through the process.

For all examples below there are two pre-requirements:

  • Authorization header must always be present. 'Authorization: <Token Key> <Token Secret>'
  • cURL must be installed in your operating system

Create a customer

Start by adding the customer information.

Copy icon

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/customers' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--header
'Content-Type: application/json' \
--data-raw
'{
   "merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599",
   
"email": "john.snow@northwall.com",
   
"firstName": "John",
   
"lastName": "Snow",
   
"phoneNumber": "4541239955",
   
"address": {
       
"line1": "5th Tower",
       
"line2": null,
       
"city": "North Wall",
       
"state": "Winterfell",
       
"country": "Westeros",
       
"zipCode": "012345"
   }
}
'

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/customers' \--header 'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \--header 'Content-Type: application/json' \--data-raw '{ "merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599", "email": "john.snow@northwall.com", "firstName": "John","lastName": "Snow","phoneNumber": "4541239955","address": {"line1": "5th Tower","line2": null,"city": "North Wall","state": "Winterfell","country": "Westeros","zipCode": "012345"}}'
Sample Response

Create a Plaid render token

Waivr uses Plaid to collect bank account information from your customer.

Copy icon

curl --location --request POST
'https://stage.waivr.co/api/waivr-app/v1/connectaccounts/render' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--header
'Content-Type: application/json' \
--data-raw
'{
 "merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599"
}

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/connectaccounts/render' \--header 'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \--header 'Content-Type: application/json' \--data-raw '{"merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599"}'
Sample Response

Use a Plaid token

Waivr uses Plaid to collect bank account information from your customer. Here is an example of the integration to render Plaid.

<html>
<!--=================================================
   STYLES AND PAGE INSTRUCTIONS. IGNORE THIS STUFF
   =================================================-->

<
head>
    <
style>
       .
outer { justify-self: center; margin: 20% auto 120px auto; width: 60%; ; font-family: 'Roboto', sans-serif;} a { text-decoration: underline; } li { padding-left: 1rem;}
   </
style>
</
head>
<!--=================================================
   PLAID SCRIPTS. HERE'S THE STUFF YOU'LL EDIT!
   =================================================-->

<
script
src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<
script
src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<
script type="text/javascript">
   (
function($) {
       
var handler = Plaid.create({
           
token: 'link-sandbox-613f419b-f7a0-4410-9a4a-e5c44212f7a1
',
           
onSuccess: function(public_token, metadata) {
               
console.log('public token is:', public_token, metadata);
           },
           
onExit: function(err, metadata) {
               
console.log('onexit invoked');
           },
           
onEvent: function(eventName, metadata) {
               
console.log('event name is:', eventName);
           }
       });
       
$('#link-button').on('click', function(e) { handler.open() });
   })(
jQuery);
</
script>
</
body>
</
html>

For more details about Plaid, please visit their documentation.

Connect a bank account

In order to create a bank account connection, your customer will need to complete the Plaid user flow.

Plaid screenshotPlaid screenshotPlaid screenshotPlaid screenshot

At the end of the flow, you will need to collect the following information to pass to Waivr:

account_id
External identification for customer’s bank account
institution_id
External identification for customer’s bank institution
public_token
Onboarding token that allows Waivr to finish the bank account connection
Sample Response

Add a bank account

Pass the information collected in the previous step to finalize the bank connection.

Copy icon

curl --location --request POST
'https://stage.waivr.co/api/waivr-app/v1/connectaccounts/connect' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--header
'Content-Type: application/json' \
--data-raw
'{
 "merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599",
 "customerUid": "7aee19e1-b1ac-40e5-91e1-14eaefe73138",
 "institution": {
  
 "identifier": "ins_4",
   
"accountIdentifier": "goadzaX3gAseb6eJGnGDTXAkka31rAi43rg38"
 }
,
 "publicToken": "public-sandbox-4aa91553-561e-4bd6-ac59-d9d8f643fdce"
}
'

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/connectaccounts/connect' \--header 'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \--header 'Content-Type: application/json' \--data-raw '{"merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599","customerUid": "7aee19e1-b1ac-40e5-91e1-14eaefe73138","institution": {"identifier": "ins_4","accountIdentifier": "goadzaX3gAseb6eJGnGDTXAkka31rAi43rg38"},"publicToken": "public-sandbox-4aa91553-561e-4bd6-ac59-d9d8f643fdce"}'
Sample Response

Create a payment instruction

A payment instruction contains the details of the payment request.

Copy icon

curl --location --request POST
'https://stage.waivr.co/api/waivr-app/v1/paymentinstructions' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--header
'Content-Type: application/json' \
--data-raw
'{
 "externalReferenceIdentifier" : "ancestry.com",
 "customerUid" : "7aee19e1-b1ac-40e5-91e1-14eaefe73138",
 "merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599",
 "amount" : 19.99,
 "frequency" : {
 
  "recurrence" : 1,
  
 "cycle" : "MONTHLY"
 }
}
'

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/paymentinstructions' \--header 'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \--header 'Content-Type: application/json' \--data-raw '{"externalReferenceIdentifier" : "north-wall-armory-invoice-1670877136","customerUid" : "7aee19e1-b1ac-40e5-91e1-14eaefe73138","merchantUid": "67f14ac8-74c3-428c-b577-bd999bc4a599","amount" : 10.99,"frequency" : {"recurrence" : 1,"cycle" : "BI_WEEKLY"}}'
Sample Response

[Optional] Review a payment instruction

A summary of payment instruction and the customer information can be pulled in this endpoint.

Copy icon

curl --location --request GET
'https://stage.waivr.co/api/waivr-app/v1/paymentinstructions/fbc9f65d-a73e-444a-9e2a-850754674299/summary' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--data-raw ''

Sample Response

Initiate a payment

Begin processing payments.

Copy icon

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/payments' \
--header
'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \
--header
'Content-Type: application/json' \
--data-raw
'{
 
"paymentInstructionUid": "fbc9f65d-a73e-444a-9e2a-850754674299",
 
"methodType": "ACH"
}
'

curl --location --request POST 'https://stage.waivr.co/api/waivr-app/v1/payments' \--header 'Authorization: BT-EX-67f14ac8-74c3-428c-b577-bd999bc4a599 fz05JGPc1NHgR24fxqHZCBDhDLFHjVlUs6YvwwVFmLYyhiTFPL' \--header 'Content-Type: application/json' \--data-raw '{"paymentInstructionUid": "fbc9f65d-a73e-444a-9e2a-850754674299","methodType": "ACH"}'
Sample Response

Resources

Want to learn more about our API? Visit our API Reference.