Custom Account Creation


What is Custom Creation?

Custom Account Creation uses our /user/register call and allows you 100% control of the payment experience and gets merchants processing payments immediately. With the /user/register API calls, you create an account for the merchant literally behind the scenes. Then WePay completes account creation later through an email authorization from the merchant but the merchant can get going with accepting payments immediately. This also gives you the ability to do things on behalf of a merchant, including viewing their account balance and refunding payments. The goal of /user/register is getting an access_token, which is a secret parameter that lets you act on a specific merchant’s behalf.


Example

An invoicing application wants to be able to let their users create invoices and start collecting money immediately upon registration. When a new user registers, they make the /user/register call and get back an access_token which they can use to create a payment account for the user and start accepting payments for that user.

At WePay, users are merchants and their customers are payers and we’ll use those terms below.


How does it work?

There are 4 steps to /user/register:

  1. You make the /user/register call for a merchant and get back an access_token.
  2. Make the /account/create call with the access_token from step 1 to get an account_id.
  3. Use the /user/send_confirmation call to send the user an email asking them to confirm.
  4. The merchant clicks on a link in the email, confirms their new account, and sets a password.

Step 1:

Make the /user/register call and pass the merchant’s details. The merchant will be registered on WePay and you will receive an access_token for that merchant.

Note that the access_token you receive is temporary unless confirmed. See -below- for more details.

  • PHP
  • cURL
  • Ruby
  • Python

Step 2:

Each merchant requires a payment account in order to start processing payments. A payment account has its own transaction history and account balance. Once you have an access_token for each merchant, you’ll want to create a payment account for each merchant.

All you need to do is make the /account/create call with the merchant’s access_token. The account name that you specify will be used on receipts and on the credit card statement for payments made to this account.

You will receive back an account_id which you should store in your database. You will use the merchant’s account_id and access_token when processing payments with the /checkout/create call (for example). You can also use the account_id to look up the account balance and status.

  • PHP
  • cURL
  • Ruby
  • Python

Step 3:

Now that the user is registered and an account has been setup, you can send the user a co-branded email letting them know that your app is going to start processing payments for them on WePay.

To do so, make the /user/send_confirmation call.

  • PHP
  • cURL
  • Ruby
  • Python

Step 4:

The merchant will click on the call to action in the email and will be taken to a page where they can confirm this process. They will choose a password that will let them log into WePay at a later date. They will then be returned to the redirect_uri you set in step 1.


What happens if the merchant doesn’t confirm?

The temporary access token will expire 90 days after its creation if not approved. You can send the user an email to confirm their WePay account using the /user/send_confirmation call.

Accounts created with a temporary access token have a few restrictions.

  • They will deleted when the temporary access token expires.
  • They will also be deleted 14 days after they accept their first payment.
  • They can only accept $100,000.

Once an account created with a temporary access token is deleted, all accepted payments will be refunded.


Next Steps

Now that you have an account_id and an access_token, you can help the merchant accept payments. Read the process payments overview for information on how to do that.