Elevate API

The Elevate APIs can be used to make autonomous purchases on behalf of your customers.
Please see our detailed integration guides for common flows and how to get started.
Need help? Reach out in your slack channel or email us at support@useelevate.dev.

BASE URL
https://api-agent.useelevate.dev

List PurchaseIntents

Returns a list of your PurchaseIntents. The PurchaseIntents are returned sorted by creation date, with the most recently created PurchaseIntent appearing first.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Query Parameters

limit

optional, integer, default: 10, maximum value of 100, minimum value of 1

A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.

page

optional, integer, default: 1, minimum value of 1

The page to request for the list. The default is 1.

customer_id

optional, string

Only return purchases for this customer_id.

GET
/v1/purchase_intents
1

Create a PurchaseIntent

Creates a PurchaseIntent.
A PurchaseIntent guides you through the process of making a purchase for your customer. We recommend that you create exactly one PurchaseIntent for each purchase in your system.
Once a PurchaseIntent has been created, it will move to one of the following states:

  • ineligible_for_automatic_checkout: The PurchaseIntent is ineligible for autonomous checkout. No further action can be taken on it.
  • requires_confirmation: The PurchaseIntent is eligible for autonomous checkout, and there are no choices to be made (e.g. no product variants to choose and only one possible option for shipping). In this case, the next step is confirming the PurchaseIntent (you should still confirm this information with the user before confirming). You can create a PurchaseIntent in either livemode (livemode = true) or testmode (livemode = false). A PurchaseIntent created in testmode will not attempt to initiate a real purchase. You must set livemode to true to execute a real purchase. You can only create a livemode PurchaseIntent with a livemode Customer, and vice versa.
Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Request Body

customer_id

required, string, minimum length of 1

The unique ID of the customer making this PurchaseIntent.

product_url

required, string

The URL of the product to purchase.

livemode

optional, boolean

Whether to create this PurchaseIntent in livemode or not. When livemode is set to true, a real purchase will be initiated. This defaults to false.
PurchaseIntents in livemode can only be created for a Customer in livemode. Similarly, PurchaseIntents in testmode can only be created for a Customer in testmode.

POST
/v1/purchase_intents
1
EXAMPLE BODY
{
  "customer_id": "cus_my-test-customer",
  "product_url": "https://www.test-useelevate.dev/p=success",
  "livemode": true
}

Retrieve a PurchaseIntent

Retrieves a PurchaseIntent.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

id

required, string

Unique ID of the PurchaseIntent to retrieve.

GET
/v1/purchase_intents/:id
1

Cancel a PurchaseIntent

Cancels a PurchaseIntent.
You can cancel a PurchaseIntent prior to its confirmation. After it is canceled, no additional operations can be made on the PurchaseIntent.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

id

required, string

Unique ID of the PurchaseIntent to cancel.

POST
/v1/purchase_intents/:id/cancel
1

Confirm a PurchaseIntent

Confirms a PurchaseIntent.
Upon confirming, the purchase will be executed and customer's payment method charged. We highly suggest confirming with your customer explicitly to confirm they want to make the purchase before executing this step.
Upon confirmation, the PurchaseIntent will attempt to initiate a purchase. If the request to purchase has been successfully kicked off, the state will transition to initated. The purchase then happens asynchronously.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

id

required, string

Unique ID of the PurchaseIntent to confirm.

Request Body

expected_estimated_amount_total

required, integer

The expected estimated total amount, in smallest units of the currency (e.g. cents for USD) of the product. For example $23.32 would be 2332.
This value must be equal to the estimated total price we identified for the item, or confirmation will not proceed.

POST
/v1/purchase_intents/:id/confirm
1
EXAMPLE BODY
{
  "expected_estimated_amount_total": 2332
}

Retrieve a Customer

Retrieves a Customer.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Path Parameters

id

required, string

Unique ID of the Customer to retrieve.

GET
/v1/customers/:id
1

Create a ClientToken

Creates a client token (e.g. for customer onboarding flow).
The client token will expire 1 hour from creation.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

POST
/v1/client_tokens
1

Retrieve product data

Retrieve product data for a unique product variant URL.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Query Parameters

product_url
required

The URL of the product for which to retrieve product data. This accepts a maximum of 10 product URLs.

GET
/v1/product_data
1

Retrieve variant data

Retrieve variant data for a product URL.

Protected by API Key

Headers

Authorization

required, string

The Authorization header is used to authenticate with the API using your API key. Value is of the format Bearer YOUR_KEY_HERE.

Query Parameters

product_url

required, string

The URL of the product for which to retrieve variant data.

GET
/v1/variant_data
1