Payments

Create Purchase URL

Changed on

Creates a secure checkout URL for purchasing a product.

post/payments/purchases/create-purchase-url

Request

  • Base URL
    https://api.hexclave.com/api/v1
  • URL
    https://api.hexclave.com/api/v1/payments/purchases/create-purchase-url
  • Auth
    none declared

Request body

customer_type'user' | 'team' | 'custom' required

The type of customer making the purchase

customer_idstring required

The ID of the customer (user ID, team ID, or custom customer ID)

product_idstring

The ID of the product to purchase. Either this or product_inline should be given.

return_urlstring

URL to redirect to after purchase completion. Must be configured as a trusted domain in the project configuration.

Example request

{
  "customer_type": "user",
  "customer_id": "user_1234567890abcdef",
  "product_id": "prod_premium_monthly",
  "return_url": "https://myapp.com/purchase-success"
}

Response

Successful response

urlstring required

The secure checkout URL for completing the purchase

Changes

    • info

      the request property / became nullable

    • info

      the request property / became nullable

    • info

      the request property / became nullable

    • breaking

      request property was restricted to a list of enum values

    • breaking

      request property / was restricted to a list of enum values

    • breaking

      the // request property type changed from number to integer

    • info

      added the new custom enum value to the request property

    • info

      added the new custom enum value to the request property /

    • info

      added the new team enum value to the request property

    • info

      added the new team enum value to the request property /

    • info

      added the new user enum value to the request property

    • info

      added the new user enum value to the request property /