pub struct CatalogApi { /* private fields */ }
Expand description

Programmatically catalogs a Square seller’s products for sale and services for hire.

Implementations§

Instantiates a new CatalogApi

Deletes a set of [CatalogItem]s based on the provided list of target IDs and returns a set of successfully deleted IDs in the response.

Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a CatalogItem will also delete all of its [CatalogItemVariation] children.

BatchDeleteCatalogObjects succeeds even if only a portion of the targeted IDs can be deleted. The response will only include IDs that were actually deleted.

Returns a set of objects based on the provided ID.

Each [CatalogItem] returned in the set includes all of its child information including: all of its [CatalogItemVariation] objects, references to its [CatalogModifierList] objects, and the ids of any [CatalogTax] objects that apply to it.

Creates or updates up to 10,000 target objects based on the provided list of objects.

The target objects are grouped into batches and each batch is inserted/updated in an all-or-nothing manner. If an object within a batch is malformed in some way, or violates a database constraint, the entire batch containing that item will be disregarded. However, other batches in the same request may still succeed. Each batch may contain up to 1,000 objects, and batches will be processed in order as long as the total object count for the request (items, variations, modifier lists, discounts, and taxes) is no more than 10,000.

Uploads an image file to be represented by a [CatalogImage] object that can be linked to an existing [CatalogObject] instance.

The resulting CatalogImage is unattached to any CatalogObject if the object_id is not specified.

This CreateCatalogImage endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.

Uploads a new image file to replace the existing one in the specified [CatalogImage] object.

This UpdateCatalogImage endpoint accepts HTTP multipart/form-data requests with a JSON part and an image file part in JPEG, PJPEG, PNG, or GIF format. The maximum file size is 15MB.

Retrieves information about the Square Catalog API, such as batch size limits that can be used by the BatchUpsertCatalogObjects endpoint.

Returns a list of all [CatalogObject]s of the specified types in the catalog.

The types parameter is specified as a comma-separated list of the [CatalogObjectType] values, for example, “ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX, IMAGE”.

Important: ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use [SearchCatalogObjects] and set the include_deleted_objects attribute value to true.

Creates or updates the target [CatalogObject].

Deletes a single [CatalogObject] based on the provided ID and returns the set of successfully deleted IDs in the response.

Deletion is a cascading event such that all children of the targeted object are also deleted. For example, deleting a [CatalogItem] will also delete all of its [CatalogItemVariation] children.

Returns a single [CatalogItem] as a [CatalogObject] based on the provided ID.

The returned object includes all of the relevant [CatalogItem] information including: [CatalogItemVariation] children, references to its [CatalogModifierList] objects, and the ids of any [CatalogTax] objects that apply to it.

Searches for [CatalogObject] of any type by matching supported search attribute values, excluding custom attribute values on items or item variations, against one or more of the specified query filters.

This (SearchCatalogObjects) endpoint differs from the SearchCatalogItems endpoint in the following aspects:

  • SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
  • SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
  • SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
  • The both endpoints have different call conventions, including the query filter formats.

Searches for catalog items or item variations by matching supported search attribute values, including custom attribute values, against one or more of the specified query filters.

This (SearchCatalogItems) endpoint differs from the SearchCatalogObjects endpoint in the following aspects:

  • SearchCatalogItems can only search for items or item variations, whereas SearchCatalogObjects can search for any type of catalog objects.
  • SearchCatalogItems supports the custom attribute query filters to return items or item variations that contain custom attribute values, where SearchCatalogObjects does not.
  • SearchCatalogItems does not support the include_deleted_objects filter to search for deleted items or item variations, whereas SearchCatalogObjects does.
  • The both endpoints use different call conventions, including the query filter formats.

Updates the [CatalogModifierList] objects that apply to the targeted [CatalogItem] without having to perform an upsert on the entire item.

Updates the [CatalogTax] objects that apply to the targeted [CatalogItem] without having to perform an upsert on the entire item.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more