Skip to main content

Goal

Create a user in order that their payment information can be securely stored and reused across transactions.

Steps

Step 1: Create a user

What you need to do

When a user who has not previously been registered with the API loads your application, create a new user by calling the API. This should be done once per user in your system.

How to do it

  1. Make an authenticated request to the create-user endpoint with the user’s identity information.
  2. Persist the returned id in your database.
curl --request POST \
  --url https://sandbox.pushcash.com/user \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": {
    "first": "Alfred",
    "last": "Hitchcock"
  },
  "email": "alfred@imdb.com",
  "address": {
    "address_line_1": "1609 10th Ave",
    "locality": "Bodega Bay",
    "administrative_area": "CA",
    "postal_code": "94923",
    "country": "US"
  },
  "date_of_birth": "1899-08-13",
  "government_id": {
    "type": "passport",
    "last4": "7349"
  },
  "phone_number": "(555) 681-3485",
  "tag": "4c8e6b4f",
  "identity_verified": true
}
'
{
  "id": "user_lVpbPL0K1XIiHx0DxipRbD"
}

Integration checklist

  • Create a user only once per internal user
  • Store the returned user’s id alongside your internal user record
  • Provide your internal user identifier in the tag field to ensure idempotency

Next steps

Now that you are registering users with the API, learn how to add a new card and process a transaction for a user.