put https://eu.api.capillarytech.com/api_gateway/rewards/core/v1/vendor/119
That's an excellent and clear summary of the API's purpose.
Here is a polished version with a minor typo corrected:
"This API allows you to update the attributes of an existing vendor. It allows you to update various fields, including the vendor's name, status, rank, configuration details, and associated media like images and videos."
Example Request
curl https://{base url}/rewards/core/v1/vendor/{vendor id} \
-u sk_test_123: \
-X PUT \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Vendor Name",
"enabled": true,
"type": "REWARDS",
"rank": 5,
"code": "VENDOR-ABC",
"description": "This is an updated vendor description.",
"isEncryptionRequired": true,
"vendorTypes": [
"LOYALTY",
"MARKETING"
],
"vendorDetails": {
"configKey1": "configValue1",
"configKey2": "configValue2"
},
"images": [
{
"handle": "image_handle_1"
}
],
"videos": []
}'
Pre-requisites
- Authentication: N/A
- Access group resource: N/A
- Rate limit: N/A
Body Parameters
Field | Type | Required | Description |
---|---|---|---|
name | string | Yes | Vendor name. Cannot be null or empty when present. |
enabled | boolean | Yes | Vendor status. Cannot be null when explicitly set. Only one POINTS vendor can be active per organization. |
type | string | Yes | Vendor type (REWARDS / POINTS ). Cannot be changed after creation in case of POINTS vendors. Cannot be set to null. |
rank | integer | Optional | Display order. Can be set to null to remove ranking. When provided, must be greater than 0. |
code | string | Optional | Vendor identifier. Can be set to null . When provided, must be unique and have a maximum of 255 characters. |
description | string | Optional | Vendor description. Can be set to null . When provided, maximum of 1034 characters. |
isEncryptionRequired | boolean | Optional | Encryption flag. Cannot be null when explicitly set. When true , vendorTypes becomes mandatory. |
vendorTypes | array<string> | Conditional | Vendor classification. Required when isEncryptionRequired is true . Can be set to null otherwise. |
vendorDetails | object | Optional | Key-value configuration. Can be set to null to mark all existing vendor details as inactive. When provided as a map (e.g., {"key1": "value1"} ), keys are strings and values are strings; values are automatically encrypted. If omitted, no changes are made. |
images | array<object> | Optional | Vendor images. Can be set to null to remove all images. When provided, maximum of 5 images. Internal objects (e.g., {"handle": "image_handle_1"} ) require valid file handles. If omitted, existing media is preserved. |
videos | array<object> | Optional | Vendor videos. Can be set to null to remove all videos. When provided, maximum of 2 videos. Internal objects (e.g., {"handle": "video_handle_1"} ) require valid file handles. If omitted, existing media is preserved. |
Example Response
{
"status": {
"success": true,
"code": "VENDOR_UPDATED",
"message": "Vendor updated successfully"
},
"vendor": {
"id": 123,
"name": "Updated Name",
"vendorDetails": {
"key1": "******",
"key2": "********"
}
}
}
Response Parameters
Field | Type | Description |
---|---|---|
status | object | Overall status of the API call. |
status.success | boolean | Indicates if the operation was successful. |
status.code | string | An application-specific code for the status. |
status.message | string | A human-readable message about the status. |
vendor | object | Details of the updated vendor. |
vendor.id | integer | Unique identifier for the vendor. |
vendor.name | string | Name of the vendor. |
vendor.vendorDetails | object | Key-value configuration for the vendor. Values are masked for security. |
vendor.vendorDetails.key1 | string | Masked value for example configuration key1. |
vendor.vendorDetails.key2 | string | Masked value for example configuration key2. |
Error Codes
Code | Description |
---|---|
INVALID_REQUEST | Bad Request. The request body or parameters are invalid or missing required fields. (e.g., Vendor name is required). |
400 | Bad Request. General client-side error due to malformed syntax or invalid parameters. |
409 | Conflict. Request conflicts with current state of the resource (e.g., duplicate unique code, POINTS vendor uniqueness). |
500 | Internal Server Error. An unexpected error occurred on the server. |