Purchase

Create

POST method to create a purchase

Parameters

Name Description
account_id required Your account unique identifier to access API.
contact_id required Id of the contact
campaign_id Id of the campaign
products[UUID] required Universally unique identifier (UUID) of the product
products[status] Status of purchases of the product, please use only the following status: add_cart, purchase, remove_cart, product_view, product_refund, purchase_failed, canceled, no_show, no_paid, check_in, check_out, reserved, confirmed
products[transaction_code] Transaction code of the product purchase of your backend
products[redeem_coupon_code] Coupon code used in the purchase
products[name] Name of the purchase transaction
products[description] Description of the purchase transaction
products[price] required Price of the purchase transaction
products[currency] required Currency of the purchase transaction
products[Your variable product] You can create a variable product and use it within your API request: 'https://www.cendyncrm.com/settings/product_custom_fields'

Request

Route
POST 
/v2/account/:account_id/contact/:contact_id/purchases
Headers
Accept: application/json 
Authorization: Token token={account.secret}
Content-Type: application/json
Body
{
  "campaign_id": "57680042edb7aad202000005",
  "products": [
    {
      "status": "purchase",
      "transaction_code": "4230923jda023230",
      "UUID": "3210938120313912312",
      "name": "Iphone6",
      "price": 748.45,
      "currency": "EUR",
      "description": "3D Touch. 12MP photos. 4K video.One powerful phone."
    }
  ]
}

Response

Status
201
Body
{
  "purchases": [
    {
      "created_at": "2016-06-22T10:37:34Z",
      "id": "576a6a6eedb7aab9c2000006",
      "status": "purchase",
      "contact_id": "57680042edb7aad202000001",
      "campaign_id": "57680042edb7aad202000005",
      "product_UUID": "3210938120313912312"
    }
  ]
}