Create products

This article explains how to create or delete a product using the Rezdy Supplier API, how to add or delete product images and current limitations.

We will use these endpoints:

  • create a product: POST /products
  • update a product: PUT /products/{productCode}
  • delete a product: DELETE /products/{productCode}
  • add a product image: POST /products/{productCode}/images
  • delete a product image: DELETE /products/{productCode}/images/{imageId}

Product images

First, a product has to be created usingPOST /products, the response contain a product object upon a successful creation. Use the product code to for the add/delete images URLs.

Use a standard file upload request (multipart form data) with a file attachment, parameter name is 'file' as the call payload. If you have multiple images, you need to make one separate call for each image. Successful response contains generated image URLs including different image dimension and the image Id. Use the image Id to delete the image, if you want to remove it from the product.

Product booking fields

Product booking fields create and update is supported via API. There is a set of build-in booking fields provided by Rezdy, consider using them instead of creating custom alternatives. The build-in fields include:

  • Title : MR, MS, MRS, MISS
  • First Name: String
  • Middle Name: String
  • Last Name: String
  • Phone: Phone
  • Mobile: Phone
  • Fax: String
  • Skype: String
  • Email: String
  • Gender: MALE, FEMALE
  • Date of birth: Date
  • Preferred Language: String (Format of the language is ISO 639 two-letter code with BCP 47 language variants, however a validation is not enforced right now)
  • Company Name: String
  • Address: String
  • City: String
  • Country: ISO 3166-1 alpha-2 codes
  • State/County/Region: String
  • Postcode/ZIP: String
  • Subscribe to the newsletter: Boolean
  • I agree to receive marketing emails: Boolean
  • How did you hear about us?: String
  • Special Requirements: String
  • Message to recipient: String
  • Signed SmartWaiver: String
  • Barcode: String

If you need to create custom booking fields, a label can not match any of the build-in types, the maximum length is 255 letters and the following field types are supported: * String: default * List: you need to send also listOptions field with list of possible values separated by \r\n * Boolean

Price Options

Only product pricing "By Person" and "Fixed" is currently supported, therefore "By Item" and "Duration" pricing for rental products cannot be created yet.

For "By Person" pricing use preferably on of the pre-defined types if suitable, otherwise specify a custom label. Pre-defined type are the following: * Quantity * Adult * Child * Infant * Senior * Teenager * Student * Concession * Custom * Family of 3 * Family of 4 * Family of 5 * 1 Adult + 2 Children * 1 Adult + 3 Children * 2 Adults + 1 Child * 2 Adults + 2 Children * 2 Adults + 3 Children * Group * Participants

To create a "Fixed" price, send only a single price option in the request:

    "priceOptions": [
        {
            "price": 100,
            "label": "Quantity",
            "priceGroupType": "TOTAL"
       }
     ]

Example calls:

Create a product

Request:

POST https://api.rezdy.com/latest/products/?apiKey=123456789XYZ
{
    "productType": "ACTIVITY",
    "name": "MockProduct",
    "shortDescription": "Please enter a basic description of this product. This must be at least 15 characters long, and can be up to 240 characters long if required. Formatting is not allowed, so please use plain text only.",
    "description": "<h4>Description.</h4> Product Description can be in HTML format, however for the styling and security reason the context is limited to the HTML tags 'strong', 'b', 'i', 'em', 'br', 'p', 'div', 'ul', 'ol', 'li','h4', 'a'. Each of the tags, can only have 'class' attribute, except tag 'a', where also 'href' and 'target' is allowed.",
    "internalCode": "MockProductUQ",
    "priceOptions": [
        {
            "price": 100,
            "label": "Adult",
            "seatsUsed": 1
        },
        {
            "price": 180,
            "label": "CustomDouble",
            "seatsUsed": 2
        }
    ],
    "unitLabel": "MockProduct",
    "unitLabelPlural": "MockProduct",
    "quantityRequired": true,
    "quantityRequiredMin": 1,
    "quantityRequiredMax": 100,
    "bookingFields": [
        {
            "label": "Date of birth",
            "requiredPerParticipant": true,
            "requiredPerBooking": true,
            "visiblePerParticipant": true,
            "visiblePerBooking": true
        },
        {
            "label": "Mobile",
            "requiredPerParticipant": false,
            "requiredPerBooking": false,
            "visiblePerParticipant": true,
            "visiblePerBooking": true
        },
        {
            "label": "Custom String",
            "requiredPerParticipant": false,
            "requiredPerBooking": false,
            "visiblePerParticipant": false,
            "visiblePerBooking": true
        },
        {
            "label": "Custom Checkbox",
            "requiredPerParticipant": false,
            "requiredPerBooking": false,
            "visiblePerParticipant": false,
            "visiblePerBooking": true,
            "fieldType": "Boolean"
        },
        {
            "label": "Custom List",
            "requiredPerParticipant": false,
            "requiredPerBooking": false,
            "visiblePerParticipant": false,
            "visiblePerBooking": true,
            "fieldType": "List",
            "listOptions": "value1\r\nvalue2"
        }
    ],
    "confirmMode": "AUTOCONFIRM",
    "minimumNoticeMinutes": 2880,
    "durationMinutes": 60,
    "locationAddress": {
        "addressLine": "MockAddress Line1",
        "addressLine2": "MockAddress Line2",
        "city": "MockAddress City",
        "countryCode": "MockAddress Country Code",
        "latitude": 48.81962499999999,
        "longitude": 20.374786800000038
    },
    "additionalInformation": "<b>AdditionalInformation<b> can be in HTML format, however for the security reason the context is limited WhiteList of Tags defined by <a href='https://jsoup.org/apidocs/org/jsoup/safety/Whitelist.html#relaxed--' target='_blank'>JSoup relaxed whitelist</a>",
    "languages": [
        "sk",
        "en_au",
        "en"
    ]
}

Response: 

{
	"requestStatus": {
		"success": true,
		"version": "v1"
	},
	"product": {
		"productType": "ACTIVITY",
		"name": "MockProduct",
		"shortDescription": "Please enter a basic description of this product. This must be at least 15 characters long, and can be up to 240 characters long if required. Formatting is not allowed, so please use plain text only.",
		"description": "<h4>Description.</h4> Product Description can be in HTML format, however for the styling and security reason the context is limited to the HTML tags 'strong', 'b', 'i', 'em', 'br', 'p', 'div', 'ul', 'ol', 'li','h4', 'a'. Each of the tags, can only have 'class' attribute, except tag 'a', where also 'href' and 'target' is allowed.",
		"productCode": "PVP15V",
		"internalCode": "MockProductUQ",
		"supplierId": 9401,
		"supplierAlias": "dusan123",
		"supplierName": "Dusan",
		"timezone": "Australia/Sydney",
		"priceOptions": [
			{
				"id": 3728,
				"price": 100,
				"label": "Adult",
				"seatsUsed": 1
			},
			{
				"id": 3729,
				"price": 180,
				"label": "CustomDouble",
				"seatsUsed": 2
			}
		],
		"currency": "AUD",
		"unitLabel": "MockProduct",
		"unitLabelPlural": "MockProduct",
		"quantityRequired": true,
		"quantityRequiredMin": 0,
		"quantityRequiredMax": 100,
		"images": [
		],
		"bookingMode": "INVENTORY",
		"charter": false,
		"generalTerms": "",
		"extras": [
		],
		"bookingFields": [
			{
				"label": "Date of birth",
				"requiredPerParticipant": true,
				"requiredPerBooking": true,
				"visiblePerParticipant": true,
				"visiblePerBooking": true
			},
			{
				"label": "Mobile",
				"requiredPerParticipant": false,
				"requiredPerBooking": false,
				"visiblePerParticipant": true,
				"visiblePerBooking": true
			},
			{
                "label": "Custom String",
                "requiredPerParticipant": false,
                "requiredPerBooking": false,
                "visiblePerParticipant": false,
                "visiblePerBooking": true
            },
            {
                "label": "Custom Checkbox",
                "requiredPerParticipant": false,
                "requiredPerBooking": false,
                "visiblePerParticipant": false,
                "visiblePerBooking": true,
                 "fieldType": "Boolean"
            }
            ,
            {
                "label": "Custom List",
                "requiredPerParticipant": false,
                "requiredPerBooking": false,
                "visiblePerParticipant": false,
                "visiblePerBooking": true,
                 "fieldType": "List",
                 "listOptions": "value1\r\nvalue2"
            }
		],
		"latitude": 48.81962499999999,
		"longitude": 20.374786800000038,
		"confirmMode": "AUTOCONFIRM",
		"commissionIncludesExtras": false,
		"dateCreated": "2016-12-21T06:31:58.897Z",
		"minimumNoticeMinutes": 2880,
		"durationMinutes": 60,
		"dateUpdated": "2016-12-21T06:32:01.32Z",
		"locationAddress": {
			"addressLine": "MockAddress Line1",
			"addressLine2": "MockAddress Line2",
			"city": "MockAddress City",
			"countryCode": "MockAddress Country Code",
			"latitude": 48.81962499999999,
			"longitude": 20.374786800000038
		},
		"additionalInformation": "<b>AdditionalInformation<b> can be in HTML format, however for the security reason the context is limited WhiteList of Tags defined by <a href=\"https://jsoup.org/apidocs/org/jsoup/safety/Whitelist.html#relaxed--\">JSoup relaxed whitelist</a></b></b>",
		"languages": [
			"sk",
			"en_au",
			"en"
		]
	}
}

Add a product image

Request:

POST https://api.rezdy.com/latest/products/PVP15V/images?apiKey=123456789XYZ

content-type=[multipart/form-data; boundary=----WebKitFormBoundarymDtt4W0lhmAsKFkZ]

------WebKitFormBoundarymDtt4W0lhmAsKFkZ
Content-Disposition: form-data; name="file"; filename="myImage.png"
Content-Type: image/png
...
IMAGE BINARY DATA
...
------WebKitFormBoundarymDtt4W0lhmAsKFkZ--

Response: 

{  
 "requestStatus": {  
 "success": true,  
 "version": "v1"  
 },  
 "image": {  
 "id": 908,  
 "itemUrl": "https://imgdev.rezdy.com/PRODUCT_IMAGE/9401/fd949a3439a24654a7e3d37790b2465emyImage.png",  
 "thumbnailUrl": "https://imgdev.rezdy.com/PRODUCT_IMAGE/9401/fd949a3439a24654a7e3d37790b2465emyImage_tb.png",  
 "mediumSizeUrl": "https://imgdev.rezdy.com/PRODUCT_IMAGE/9401/fd949a3439a24654a7e3d37790b2465emyImage_med.png",  
 "largeSizeUrl": "https://imgdev.rezdy.com/PRODUCT_IMAGE/9401/fd949a3439a24654a7e3d37790b2465emyImage_lg.png"  
 }  
}

other possible request format, which is common for PHP frameworks, that send an array of parameters:

POST https://api.rezdy.com/latest/products/PVP15V/images?apiKey=123456789XYZ

content-type=[multipart/form-data; boundary=----WebKitFormBoundarymDtt4W0lhmAsKFkZ]

------WebKitFormBoundarymDtt4W0lhmAsKFkZ
Content-Disposition: form-data; name="filename"  
myImage.png
...
IMAGE BINARY DATA
...
------WebKitFormBoundarymDtt4W0lhmAsKFkZ--

Remove a product image

Request:

DELETE https://api.rezdy.com/latest/products/PVP15V/images/908?apiKey=123456789XYZ

Response: 

{  
 "requestStatus": {  
 "success": true,  
 "version": "v1"  
 }  
}  

Delete a product

Request:

DELETE https://api.rezdy.com/latest/products/PVP15V?apiKey=123456789XYZ

Response: 

{  
 "requestStatus": {  
 "success": true,  
 "version": "v1"  
 }  
}  

Notes & API Limitations:

Products will be created with booking mode "Inventory" (meaning you then need to create sessions to open availability)

Product Description can be in HTML format, however for styling and security reason only limited HTML tags are allowed: "strong", "b", "i", "em", "br", "p", "div", "ul", "ol", "li","h4", "a". Each of the tags, can only have "class" attribute, except tag "a", where also "href" and "target" is allowed.

Product AdditionalInformation can be in HTML format, however for the security reason the context is a limited white-list of Tags defined by JSoup relaxed whitelist