api:catalogs

Catalogs

GET /catalogs/{catalog-id}

This method returns a catalog with all its elements.

GET https://api.pyrus.com/v4/catalogs/422
Show response

{
  "catalog_id": 6625,
  "name": "Clients",
  "catalog_headers": [
    {
      "name": "Name",
      "type": "text"
    },
    {
      "name": "Company",
      "type": "text"
    }
  ],
  "items": [
    {
      "item_id": 15200,
      "values": [
        "Reatha Middendorf",
        "Acme, inc."
      ]
    },
    {
      "item_id": 15201,
      "values": [
        "Daedra Ullrich",
        "Widget Corp"
      ]
    },
    {
      "item_id": 15202,
      "values": [
        "Andy Mahn",
        "123 Warehousing"
      ]
    }
  ]
}

PUT /catalogs

Create a catalog.
This method returns a catalog with all its elements.

PUT https://api.pyrus.com/v4/catalogs

{
  "name": "Clients",  
  "catalog_headers": [
    "Name",
    "Company"
  ],
  "items": [
    {
      "values": [
        "Reatha Middendorf",
        "Acme, inc."
      ]
    },
    {
      "values": [
        "Daedra Ullrich",
        "Widget Corp"
      ]
    },
    {
      "values": [
        "Andy Mahn",
        "123 Warehousing"
      ]
    }
  ]
}
Show response

{
  "catalog_id": 6625,
  "name": "Clients",
  "catalog_headers": [
    {
      "name": "Name",
      "type": "text"
    },
    {
      "name": "Company",
      "type": "text"
    }
  ],
  "items": [
    {
      "item_id": 15200,
      "values": [
        "Reatha Middendorf",
        "Acme, inc."
      ]
    },
    {
      "item_id": 15201,
      "values": [
        "Daedra Ullrich",
        "Widget Corp"
      ]
    },
    {
      "item_id": 15202,
      "values": [
        "Andy Mahn",
        "123 Warehousing"
      ]
    }
  ]
}

POST /catalogs/{catalog-id}

Sync a catalog.
This method updates catalog headers and items. You must define all the values and text columns that need to remain in the catalog.
All unspecified items and text columns will be deleted.
This method only changes the values. To do this, you must pass it explicitly in the list of columns. You can not add or delete workflow columns using this method.
The first column of the catalog is the key parameter. Therefore, its name cannot be changed.
This method returns a list of items that have been added, modified, or deleted.

POST https://api.pyrus.com/v4/catalogs/6625

{
  "apply": true,  
  "catalog_headers": [
    "Name",
    "Company"
  ],
  "items": [
    {
      "values": [
        "Reatha Middendorf",
        "Acme"
      ]
    },
    {
      "values": [
        "Daedra Ullrich",
        "Widget Corp"
      ]
    },
    {
      "values": [
        "Jean Overturf",
        "Demo Company"
      ]
    }
  ]
}
Show response

{
  "apply": true,
  "added": [
    {
      "item_id": 15205,
      "values": [
        "Jean Overturf",
        "Demo Company"
      ]
    }
  ],
  "deleted": [
    {
      "item_id": 15202,
      "values": [
        "Andy Mahn",
        "123 Warehousing"
      ]
    }
  ],
  "updated": [
    {
      "item_id": 15200,
      "values": [
        "Reatha Middendorf",
        "Acme"
      ]
    }
  ],
  "catalog_headers": [
    {
      "name": "Name",
      "type": "text"
    },
    {
      "name": "Customer Company",
      "type": "text"
    }
  ]
}

Parameters

apply Define this as true if you want to apply changes, or false if you want to calculate which items will be added/deleted/updated.
catalog_headers An array of catalog headers. All unspecified text columns will be deleted.
items An array of catalog items. All unspecified items will be deleted.

Was this article helpful?

Yes, thanks! No, I have a question