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 | Type | Description |
---|---|---|
Type | String | API that will be called |
Payload | URL_ENCODED | An URL encoded JSON array |
HashString | Varchar | sha256 encoded string. Read how to create payload and hashstring |
Payload Parameters
Field | Type | Description |
---|---|---|
Reference | Varchar | Order reference |
OrderItems | array() | |
- ProductID | Integer | ID of the product you are booking |
- ProductClassName | String | This is the "type" of the product that you are booking. |
- EventID | Integer | ID of the event that will be booked |
- Quantity | Integer | How many participants |
Success 200
Field | Type | Description |
---|---|---|
Reference | String | Reference of the order |
TotalCost | Double | Total amount of the order without the Tax |
Errors | Array() |
- Success-Response:
HTTP/1.1 200 OK { "Reference": "ABC123", "TotalCost": "100.00", "Errors": [] }
Error 4xx
Field | Type | Description |
---|---|---|
Errors | array() | |
- Code | Int | Number of error |
- Error | String | Error 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.