Purchase API

Push the purchase details from your store/site to Zoho Thrive using the API instructions provided below.

Note: This API is primarily for custom-built sites that have incorporated purchase tasks like Make a Purchase or Referral Purchase from the Loyalty program or the Upon Referral Purchase task from the Affiliate program. It can also be used by stores/sites built using the platform integrations to push details of offline purchases.

 HTTP Request 

  1. Generate an OAuth token to send as a part of the request, ensuring the details of the purchase are pushed safely.
     

        OAuthScope: Thrive.Referral.CREATE

  1. Create an HTTP request with the following:

        Request Method: POST  

        Request URL: {domain URL}/thrive-publicapi/v1/{brand-code}/purchase

 Parameter Name

Parameter Key

Description

Email *

email


Email address associated with a purchase transaction


Amount *


amount


Transaction amount of a specific order.


Order ID *


order_id


Unique identifier of a specific purchase transaction


Customer ID


zt_customer_id


 Unique identifier assigned to a customer within your system to identify and distinguish them from the others.


Digest


thrive_digest


Generated HMAC 


Product Category / Group Name


product_group_name


Name given to the category/group. It must be unique.

Product ID

product_id


Unique identifier assigned to a product while listing it, to identify and distinguish it from other products.

Pay Period

product_payperiod

The designated timeframe for a plan’s payment (monthly or yearly).

Pay Plan Name

product_plan_name

Name given to the pay plan. It must be unique

* - mandatory

Customer ID and Digest details must be pushed at times when there’s a possibility for an offline purchase in your business model.

Product Category/Group Name, Product ID, Pay Period, and Pay Plan Name parameter keys should only be added if they are configured as a part of the affiliate-referral purchase task inside Zoho Thrive.

Note: The request body must contain the parameter key related to the parameter used, and not its name.

Request Response

  • 204 - Success

  • 404 - If any mandatory (*) parameters are missing

Sample Post Body

Copiedcurl --request POST \
  --url https://thrive.zoho.com/thrive-publicapi/v1/5bda3988d2d8d60313c647247a35696c845ff17ae15a2de100de4aa1b0a77333/purchase \
  --header 'Authorization: Bearer 1000.bde43b528b304341562a831b87d6889c.d9495c501be1f2c4a455f18ffe4b5b44' \
  --header 'Content-Type: application/json' \
  --data '
{
"thrive_digest": "fa04d2467feb9bbf9be79fece58d6ebc5ab0183939008f85d722a7334be3c3e",
"email": "peter.prescot@zylker.com",
"amount": "1456",
"order_id": "purchase_pd42119_3",
"zt_customer_id" : "dir_1651130310493"
}'
  • The URL in line 2 is the same as the Request URL. Do not forget to replace the URL placeholder with the Domain URL appropriate to your domain.

  • The access token generated using OAuth is sent as the Authorization in line 3.

  • Each parameter key is followed by their respective variables within the quotation marks.