Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Latest commit

 

History

History
273 lines (159 loc) · 12.3 KB

File metadata and controls

273 lines (159 loc) · 12.3 KB

CatalogApi

squareconnect.apis.catalog_api

All endpoints are relative to Square Connect V2 Documentation

Method HTTP request
batch_delete_catalog_objects POST /v2/catalog/batch-delete
batch_retrieve_catalog_objects POST /v2/catalog/batch-retrieve
batch_upsert_catalog_objects POST /v2/catalog/batch-upsert
catalog_info GET /v2/catalog/info
delete_catalog_object DELETE /v2/catalog/object/{object_id}
list_catalog GET /v2/catalog/list
retrieve_catalog_object GET /v2/catalog/object/{object_id}
search_catalog_objects POST /v2/catalog/search
update_item_modifier_lists POST /v2/catalog/update-item-modifier-lists
update_item_taxes POST /v2/catalog/update-item-taxes
upsert_catalog_object POST /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

Name Type Notes Default Value
body BatchDeleteCatalogObjectsRequest

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

Name Type Notes Default Value
body BatchRetrieveCatalogObjectsRequest

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

Name Type Notes Default Value
body BatchUpsertCatalogObjectsRequest

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

Name Type Notes Default Value
object_id str

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

Name Type Notes Default Value
cursor str [optional]
types str [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

Name Type Notes Default Value
object_id str
include_related_objects bool [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

Name Type Notes Default Value
body SearchCatalogObjectsRequest

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

Name Type Notes Default Value
body UpdateItemModifierListsRequest

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

Name Type Notes Default Value
body UpdateItemTaxesRequest

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

Name Type Notes Default Value
body UpsertCatalogObjectRequest

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]