Updates a catalog rule
PUThttps://euwest.api.elasticpath.com/catalogs/rules/:catalog_rule_id
Specify whichever attributes you want to change. The values of the other attributes remain the same. If the attributes section is empty, the catalog rule is not updated.
Request
Path Parameters
catalog_rule_id stringrequired
The catalog rule ID.
- application/json
Bodyrequired
An updated catalog rule with the following attributes.
data objectrequired
Responses
- 200
- default
An Updated catalog rule with the following attributes.
- application/json
- Schema
- Example (auto)
Schema
data objectrequired
links object
{
"data": {
"id": "8dbb35b2-ef04-477e-974d-e5f3abe6faae",
"attributes": {
"name": "rule-123",
"description": "Catalog Rule for most favored customers",
"account_ids": [
"string"
],
"customer_ids": [
"string"
],
"channels": [
"string"
],
"tags": [
"string"
],
"schedules": [
{
"valid_from": "2020-09-22T09:00:00",
"valid_to": "2020-09-22T09:00:00"
}
],
"catalog_id": "d09b4e16-08a5-4f42-817c-6e0d98acbb63",
"created_at": "2020-09-22T09:00:00",
"updated_at": "2020-09-22T09:00:00",
"pricebook_id": "string",
"pricebook_ids": [
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"priority": 0
}
]
},
"type": "catalog_rule"
},
"links": {
"self": "string",
"first": "string",
"last": "string",
"prev": "string",
"next": "string"
}
}
Unexpected error.
- application/json
- Schema
- Example (auto)
Schema
errors object[]
{
"errors": [
{
"detail": "not processable",
"status": "422",
"title": "There was a problem processing your request."
}
]
}
Authorization: Authorization
name: Authorizationtype: httpin: headerscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Put, "https://euwest.api.elasticpath.com/catalogs/rules/:catalog_rule_id");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <Authorization>");
var content = new StringContent("{\n \"data\": {\n \"id\": \"8dbb35b2-ef04-477e-974d-e5f3abe6faae\",\n \"attributes\": {\n \"name\": \"rule-123\",\n \"description\": \"Catalog Rule for most favored customers\",\n \"account_ids\": [\n \"string\"\n ],\n \"customer_ids\": [\n \"string\"\n ],\n \"channels\": [\n \"string\"\n ],\n \"schedules\": [\n {\n \"valid_from\": \"2020-09-22T09:00:00\",\n \"valid_to\": \"2020-09-22T09:00:00\"\n }\n ],\n \"tags\": [\n \"string\"\n ],\n \"catalog_id\": \"d09b4e16-08a5-4f42-817c-6e0d98acbb63\",\n \"pricebook_id\": \"string\",\n \"pricebook_ids\": [\n {\n \"id\": \"3fa85f64-5717-4562-b3fc-2c963f66afa6\",\n \"priority\": 0\n }\n ]\n },\n \"type\": \"catalog_rule\"\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear