Testing

Below, you can find instructions on how to use testmode, along with a set of useful tools to test various scenarios deterministically.

To use the Elevate APIs in testmode, follow the instructions below to generate a Customer and make a purchase. Note that you can only make purchases in testmode with Customers created in testmode.

Test customer onboarding

The below instructions allow you to onboard a Customer in testmode and test your onboarding flow.

Guest checkout

To test your Guest customer onboarding flow, you can use our test card collection component, which will create Customers in testmode.

To use the test component, change the path in the iframe URL from card to card-test:

<iframe frameborder="0" width="600" height="1200" src="https://elev4te-onboarding-423322.wm.r.appspot.com/card-test?client_token=your_client_token" />

This will create a Customer in testmode. Testmode Customers can only be used with testmode PurchaseIntents.

Test card numbers Use test card numbers with the test customer onboarding component. Here are a few examples that will work:

BrandCard numberExpiration dateCVC
Visa4242424242424242any future dateany 3 digits
Mastercard5555555555554444any future dateany 3 digits
Discover6011111111111117any future dateany 3 digits

Authenticated Amazon checkout

To test your Amazon customer onboarding flow, you can use our test account connection component, which will create Customers in testmode.

To use the test component, change the path in the iframe URL from amazon to amazon-test:

<iframe frameborder="0" width="550" height="650" src="https://elev4te-onboarding-423322.wm.r.appspot.com/amazon-test?client_token=your_client_token" />

This will create a Customer in testmode. Testmode Customers can only be used with testmode PurchaseIntents.

Test making purchases

The below instructions allow you to make a purchase in testmode. There will be no actual products purchased or payments charged while using testmode.

Creating a testmode PurchaseIntent

To make a purchase in testmode, set livemode to false when creating the PurchaseIntent (note livemode defaults to false if you do not include livemode in the request).

curl --request POST \
  --url https://api-agent.useelevate.dev/v1/purchase_intents \
  --header 'Authorization: Bearer YOUR_KEY_HERE' \
  --header 'Content-Type: application/json' \
  --data '
{
  "customer_id": "cus_my-test-customer",
  "product_url": "https://www.test-useelevate.dev/p=success",
  "livemode": false,
}
'

Test product URLs

These test product URLs can be used to mock different scenarios deterministically. We will not attempt to execute a real purchase (in either testmode or livemode) when using these test URLs.

Product URLDescription
https://www.test-useelevate.dev/p=successMocks a successful purchase for valid requests.
https://www.test-useelevate.dev/p=no_input_requiredMocks a successful purchase that doesn't need additional inputs.
https://www.test-useelevate.dev/p=no_product_variantMocks a successful purchase for a product with no variants.
https://www.test-useelevate.dev/p=single_prop_product_variantMocks a successful purchase for a product with variants that have only one property type.
https://www.test-useelevate.dev/p=multi_prop_product_variantMocks a successful purchase for a product with variants that have multiple property types.
https://www.test-useelevate.dev/p=executionMocks an execution error for the purchase. This may include a payment error (e.g. the customer's card was declined) or an issue with the execution flow of the purchase.
https://www.test-useelevate.dev/p=out_of_stockMocks the item is no longer available (e.g. out of stock) when we go to make the purchase.
https://www.test-useelevate.dev/p=price_changedMocks that the price has changed for the item.
https://www.test-useelevate.dev/p=access_expiredMocks that the customer's account authentication has expired.
https://www.test-useelevate.dev/p=ineligibleAny URL that isn't claimed for one of the above scenarios will be considered ineligible in test mode.