CatalogApi

June 12, 2019 ยท View on GitHub

squareconnect.apis.catalog_api

All endpoints are relative to Square Connect V2 Documentation

MethodHTTP request
batch_delete_catalog_objectsPOST /v2/catalog/batch-delete
batch_retrieve_catalog_objectsPOST /v2/catalog/batch-retrieve
batch_upsert_catalog_objectsPOST /v2/catalog/batch-upsert
catalog_infoGET /v2/catalog/info
delete_catalog_objectDELETE /v2/catalog/object/{object_id}
list_catalogGET /v2/catalog/list
retrieve_catalog_objectGET /v2/catalog/object/{object_id}
search_catalog_objectsPOST /v2/catalog/search
update_item_modifier_listsPOST /v2/catalog/update-item-modifier-lists
update_item_taxesPOST /v2/catalog/update-item-taxes
upsert_catalog_objectPOST /v2/catalog/object

batch_delete_catalog_objects

BatchDeleteCatalogObjectsResponse batch_delete_catalog_objects(body)

Description

Deletes a set of CatalogItems 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.

Parameters

NameTypeNotesDefault Value
bodyBatchDeleteCatalogObjectsRequest

Return type

BatchDeleteCatalogObjectsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batch_retrieve_catalog_objects

BatchRetrieveCatalogObjectsResponse batch_retrieve_catalog_objects(body)

Description

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.

Parameters

NameTypeNotesDefault Value
bodyBatchRetrieveCatalogObjectsRequest

Return type

BatchRetrieveCatalogObjectsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

batch_upsert_catalog_objects

BatchUpsertCatalogObjectsResponse batch_upsert_catalog_objects(body)

Description

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.

Parameters

NameTypeNotesDefault Value
bodyBatchUpsertCatalogObjectsRequest

Return type

BatchUpsertCatalogObjectsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

catalog_info

CatalogInfoResponse catalog_info()

Description

Returns information about the Square Catalog API, such as batch size limits for BatchUpsertCatalogObjects.

Parameters

This endpoint does not need any parameter.

Return type

CatalogInfoResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

delete_catalog_object

DeleteCatalogObjectResponse delete_catalog_object(object_id)

Description

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.

Parameters

NameTypeNotesDefault Value
object_idstr

Return type

DeleteCatalogObjectResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

list_catalog

ListCatalogResponse list_catalog(cursor=cursor, types=types)

Description

Returns a list of CatalogObjects that includes all objects of a set of desired types (for example, all CatalogItem and CatalogTax objects) in the catalog. The types parameter is specified as a comma-separated list of valid CatalogObject types: ITEM, ITEM_VARIATION, MODIFIER, MODIFIER_LIST, CATEGORY, DISCOUNT, TAX. Important: ListCatalog does not return deleted catalog items. To retrieve deleted catalog items, use SearchCatalogObjects and set include_deleted_objects to true.

Parameters

NameTypeNotesDefault Value
cursorstr[optional]
typesstr[optional]

Return type

ListCatalogResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

retrieve_catalog_object

RetrieveCatalogObjectResponse retrieve_catalog_object(object_id, include_related_objects=include_related_objects)

Description

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.

Parameters

NameTypeNotesDefault Value
object_idstr
include_related_objectsbool[optional]

Return type

RetrieveCatalogObjectResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

search_catalog_objects

SearchCatalogObjectsResponse search_catalog_objects(body)

Description

Queries the targeted catalog using a variety of query types: CatalogQuerySortedAttribute, CatalogQueryExact, CatalogQueryRange, CatalogQueryText, CatalogQueryItemsForTax, and CatalogQueryItemsForModifierList.

Parameters

NameTypeNotesDefault Value
bodySearchCatalogObjectsRequest

Return type

SearchCatalogObjectsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_item_modifier_lists

UpdateItemModifierListsResponse update_item_modifier_lists(body)

Description

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

Parameters

NameTypeNotesDefault Value
bodyUpdateItemModifierListsRequest

Return type

UpdateItemModifierListsResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

update_item_taxes

UpdateItemTaxesResponse update_item_taxes(body)

Description

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

Parameters

NameTypeNotesDefault Value
bodyUpdateItemTaxesRequest

Return type

UpdateItemTaxesResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]

upsert_catalog_object

UpsertCatalogObjectResponse upsert_catalog_object(body)

Description

Creates or updates the target CatalogObject.

Parameters

NameTypeNotesDefault Value
bodyUpsertCatalogObjectRequest

Return type

UpsertCatalogObjectResponse

Authorization

Assign your Access Token from developer portal to the authorization parameter.

[Back to top] [Back to API list] [Back to Model list] [Back to README]