APIAddToOrder

The APIAddToOrder method is a crucial component of our e-commerce system, allowing you to efficiently add items to an order. This method processes the order items specified in the payload and returns relevant order information, or an error response if the operation fails.

/api/plain/?type=APIAddToOrder&[payload]&HashString=[hashstring]

URL Parameters

 Field TypeDescription
TypeStringAPI that will be called
PayloadURL_ENCODEDAn URL encoded JSON array 
HashString Varchar sha256 encoded string. Read how to create payload and hashstring 


Payload Parameters

 Field TypeDescription
ReferenceVarcharOrder reference
OrderItems array() 
 - ProductIDIntegerID of the product you are booking
 - ProductClassNameStringThis is the "type" of the product that you are booking.
 - EventIDIntegerID of the event that will be booked
 - QuantityIntegerHow many participants


Success 200

FieldTypeDescription
ReferenceStringReference of the order
TotalCostDoubleTotal amount of the order without the Tax
ErrorsArray() 
  •  Success-Response: 
  •     HTTP/1.1 200 OK
        {
    	  "Reference": "ABC123",
    	  "TotalCost": "100.00",
    	  "Errors": []
        }

Error 4xx

FieldTypeDescription
Errorsarray() 
 - Code IntNumber of error
 - Error StringError message
  •  Error-Response: 
  •     HTTP/1.1 200 OK
        {
          "Reference": ""
          "Errors": [
    	  	{"Code":"403", "Error":"Not found order"},
    		{"Code":"104",  "Error":"Ooops, the event slots are not available"},
    		{"Code":"107",  "Error":"Resource is unavailable at this time, please select another time"},
    		{"Code":"111",  "Error":"Please complete all required product options to complete the booking."},
    		{"Code":"115",  "Error":"Please select a quantity for the main product."},
    		{"Code":"304",  "Error":"Quantity of 1 is allowed in the basket for this product"},
    	  ]
        }
>


Important Considerations

• Ensure that the Payload is meticulously formatted as a URL-encoded JSON array to avoid parsing errors.

• Double-check that the HashString is correctly generated to prevent security issues during transmission.

• Regularly monitor your API responses and implement error handling mechanisms within your application to manage the various scenarios outlined in the error codes.