heymegabyte/agent-skills / skills/square
square
VerifiedSquare API skill — auto-forged from OpenAPI 2.0. Use Square APIs to manage and run business including payment, customer, product, inventory, and employee management.
client.ts
View on GitHub// Auto-generated by forge-skill-from-openapi
// API: square
// DO NOT EDIT — re-run forge to regenerate
import type * as T from './types.js';
function appendQuery(url: string, query?: Record<string, string>): string {
if (!query || Object.keys(query).length === 0) return url;
const qs = new URLSearchParams(query).toString();
return url.includes('?') ? `${url}&${qs}` : `${url}?${qs}`;
}
export class SquareClient {
constructor(
private readonly apiToken: string,
private readonly baseUrl: string = 'https://connect.squareup.com',
) {}
private async request<T>(method: string, url: string, body?: string): Promise<T> {
const res = await fetch(url, {
method,
headers: {
'Authorization': `Bearer ${this.apiToken}`,
'Content-Type': 'application/json',
'Accept': 'application/json',
},
body,
});
if (!res.ok) {
const text = await res.text().catch(() => '');
throw new Error(`${method} ${url} → ${res.status}: ${text}`);
}
if (res.status === 204) return undefined as T;
return res.json() as T;
}
async RevokeToken(body?: RevokeTokenBody): Promise<RevokeTokenResponse> {
return this.request('POST', `https://connect.squareup.com/oauth2/revoke`, body ? JSON.stringify(body) : undefined);
},
async ObtainToken(body?: ObtainTokenBody): Promise<ObtainTokenResponse> {
return this.request('POST', `https://connect.squareup.com/oauth2/token`, body ? JSON.stringify(body) : undefined);
},
async RetrieveTokenStatus(body?: Record<string, unknown>): Promise<RetrieveTokenStatusResponse> {
return this.request('POST', `https://connect.squareup.com/oauth2/token/status`, body ? JSON.stringify(body) : undefined);
},
async V1ListOrders(location_id: string, query?: Record<string, string>): Promise<V1ListOrdersResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v1/${location_id}/orders`, query));
},
async V1RetrieveOrder(location_id: string, order_id: string): Promise<V1RetrieveOrderResponse> {
return this.request('GET', `https://connect.squareup.com/v1/${location_id}/orders/${order_id}`);
},
async V1UpdateOrder(location_id: string, order_id: string, body?: V1UpdateOrderBody): Promise<V1UpdateOrderResponse> {
return this.request('PUT', `https://connect.squareup.com/v1/${location_id}/orders/${order_id}`, body ? JSON.stringify(body) : undefined);
},
async RegisterDomain(body?: RegisterDomainBody): Promise<RegisterDomainResponse> {
return this.request('POST', `https://connect.squareup.com/v2/apple-pay/domains`, body ? JSON.stringify(body) : undefined);
},
async ListBankAccounts(query?: Record<string, string>): Promise<ListBankAccountsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bank-accounts`, query));
},
async CreateBankAccount(body?: CreateBankAccountBody): Promise<CreateBankAccountResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bank-accounts`, body ? JSON.stringify(body) : undefined);
},
async GetBankAccountByV1Id(v1_bank_account_id: string): Promise<GetBankAccountByV1IdResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bank-accounts/by-v1-id/${v1_bank_account_id}`);
},
async GetBankAccount(bank_account_id: string): Promise<GetBankAccountResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bank-accounts/${bank_account_id}`);
},
async DisableBankAccount(bank_account_id: string, body?: Record<string, unknown>): Promise<DisableBankAccountResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bank-accounts/${bank_account_id}/disable`, body ? JSON.stringify(body) : undefined);
},
async ListBookings(query?: Record<string, string>): Promise<ListBookingsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings`, query));
},
async CreateBooking(body?: CreateBookingBody): Promise<CreateBookingResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings`, body ? JSON.stringify(body) : undefined);
},
async SearchAvailability(body?: SearchAvailabilityBody): Promise<SearchAvailabilityResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/availability/search`, body ? JSON.stringify(body) : undefined);
},
async BulkRetrieveBookings(body?: BulkRetrieveBookingsBody): Promise<BulkRetrieveBookingsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/bulk-retrieve`, body ? JSON.stringify(body) : undefined);
},
async RetrieveBusinessBookingProfile(): Promise<RetrieveBusinessBookingProfileResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bookings/business-booking-profile`);
},
async ListBookingCustomAttributeDefinitions(query?: Record<string, string>): Promise<ListBookingCustomAttributeDefinitionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/custom-attribute-definitions`, query));
},
async CreateBookingCustomAttributeDefinition(body?: CreateBookingCustomAttributeDefinitionBody): Promise<CreateBookingCustomAttributeDefinitionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/custom-attribute-definitions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveBookingCustomAttributeDefinition(key: string, query?: Record<string, string>): Promise<RetrieveBookingCustomAttributeDefinitionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/custom-attribute-definitions/${key}`, query));
},
async UpdateBookingCustomAttributeDefinition(key: string, body?: UpdateBookingCustomAttributeDefinitionBody): Promise<UpdateBookingCustomAttributeDefinitionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/bookings/custom-attribute-definitions/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteBookingCustomAttributeDefinition(key: string): Promise<DeleteBookingCustomAttributeDefinitionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/bookings/custom-attribute-definitions/${key}`);
},
async BulkDeleteBookingCustomAttributes(body?: BulkDeleteBookingCustomAttributesBody): Promise<BulkDeleteBookingCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/custom-attributes/bulk-delete`, body ? JSON.stringify(body) : undefined);
},
async BulkUpsertBookingCustomAttributes(body?: BulkUpsertBookingCustomAttributesBody): Promise<BulkUpsertBookingCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/custom-attributes/bulk-upsert`, body ? JSON.stringify(body) : undefined);
},
async ListLocationBookingProfiles(query?: Record<string, string>): Promise<ListLocationBookingProfilesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/location-booking-profiles`, query));
},
async RetrieveLocationBookingProfile(location_id: string): Promise<RetrieveLocationBookingProfileResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bookings/location-booking-profiles/${location_id}`);
},
async ListTeamMemberBookingProfiles(query?: Record<string, string>): Promise<ListTeamMemberBookingProfilesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/team-member-booking-profiles`, query));
},
async BulkRetrieveTeamMemberBookingProfiles(body?: BulkRetrieveTeamMemberBookingProfilesBody): Promise<BulkRetrieveTeamMemberBookingProfilesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/team-member-booking-profiles/bulk-retrieve`, body ? JSON.stringify(body) : undefined);
},
async RetrieveTeamMemberBookingProfile(team_member_id: string): Promise<RetrieveTeamMemberBookingProfileResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bookings/team-member-booking-profiles/${team_member_id}`);
},
async RetrieveBooking(booking_id: string): Promise<RetrieveBookingResponse> {
return this.request('GET', `https://connect.squareup.com/v2/bookings/${booking_id}`);
},
async UpdateBooking(booking_id: string, body?: UpdateBookingBody): Promise<UpdateBookingResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/bookings/${booking_id}`, body ? JSON.stringify(body) : undefined);
},
async CancelBooking(booking_id: string, body?: CancelBookingBody): Promise<CancelBookingResponse> {
return this.request('POST', `https://connect.squareup.com/v2/bookings/${booking_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async ListBookingCustomAttributes(booking_id: string, query?: Record<string, string>): Promise<ListBookingCustomAttributesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/${booking_id}/custom-attributes`, query));
},
async RetrieveBookingCustomAttribute(booking_id: string, key: string, query?: Record<string, string>): Promise<RetrieveBookingCustomAttributeResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/bookings/${booking_id}/custom-attributes/${key}`, query));
},
async UpsertBookingCustomAttribute(booking_id: string, key: string, body?: UpsertBookingCustomAttributeBody): Promise<UpsertBookingCustomAttributeResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/bookings/${booking_id}/custom-attributes/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteBookingCustomAttribute(booking_id: string, key: string): Promise<DeleteBookingCustomAttributeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/bookings/${booking_id}/custom-attributes/${key}`);
},
async ListCards(query?: Record<string, string>): Promise<ListCardsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/cards`, query));
},
async CreateCard(body?: CreateCardBody): Promise<CreateCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/cards`, body ? JSON.stringify(body) : undefined);
},
async RetrieveCard(card_id: string): Promise<RetrieveCardResponse> {
return this.request('GET', `https://connect.squareup.com/v2/cards/${card_id}`);
},
async DisableCard(card_id: string, body?: Record<string, unknown>): Promise<DisableCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/cards/${card_id}/disable`, body ? JSON.stringify(body) : undefined);
},
async ListCashDrawerShifts(query?: Record<string, string>): Promise<ListCashDrawerShiftsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/cash-drawers/shifts`, query));
},
async RetrieveCashDrawerShift(shift_id: string, query?: Record<string, string>): Promise<RetrieveCashDrawerShiftResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/cash-drawers/shifts/${shift_id}`, query));
},
async ListCashDrawerShiftEvents(shift_id: string, query?: Record<string, string>): Promise<ListCashDrawerShiftEventsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/cash-drawers/shifts/${shift_id}/events`, query));
},
async BatchDeleteCatalogObjects(body?: BatchDeleteCatalogObjectsBody): Promise<BatchDeleteCatalogObjectsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/batch-delete`, body ? JSON.stringify(body) : undefined);
},
async BatchRetrieveCatalogObjects(body?: BatchRetrieveCatalogObjectsBody): Promise<BatchRetrieveCatalogObjectsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/batch-retrieve`, body ? JSON.stringify(body) : undefined);
},
async BatchUpsertCatalogObjects(body?: BatchUpsertCatalogObjectsBody): Promise<BatchUpsertCatalogObjectsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/batch-upsert`, body ? JSON.stringify(body) : undefined);
},
async CreateCatalogImage(body?: CreateCatalogImageBody): Promise<CreateCatalogImageResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/images`, body ? JSON.stringify(body) : undefined);
},
async UpdateCatalogImage(image_id: string, body?: UpdateCatalogImageBody): Promise<UpdateCatalogImageResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/catalog/images/${image_id}`, body ? JSON.stringify(body) : undefined);
},
async CatalogInfo(): Promise<CatalogInfoResponse> {
return this.request('GET', `https://connect.squareup.com/v2/catalog/info`);
},
async ListCatalog(query?: Record<string, string>): Promise<ListCatalogResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/catalog/list`, query));
},
async UpsertCatalogObject(body?: UpsertCatalogObjectBody): Promise<UpsertCatalogObjectResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/object`, body ? JSON.stringify(body) : undefined);
},
async RetrieveCatalogObject(object_id: string, query?: Record<string, string>): Promise<RetrieveCatalogObjectResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/catalog/object/${object_id}`, query));
},
async DeleteCatalogObject(object_id: string): Promise<DeleteCatalogObjectResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/catalog/object/${object_id}`);
},
async SearchCatalogObjects(body?: SearchCatalogObjectsBody): Promise<SearchCatalogObjectsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/search`, body ? JSON.stringify(body) : undefined);
},
async SearchCatalogItems(body?: SearchCatalogItemsBody): Promise<SearchCatalogItemsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/search-catalog-items`, body ? JSON.stringify(body) : undefined);
},
async UpdateItemModifierLists(body?: UpdateItemModifierListsBody): Promise<UpdateItemModifierListsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/update-item-modifier-lists`, body ? JSON.stringify(body) : undefined);
},
async UpdateItemTaxes(body?: UpdateItemTaxesBody): Promise<UpdateItemTaxesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/catalog/update-item-taxes`, body ? JSON.stringify(body) : undefined);
},
async ListChannels(query?: Record<string, string>): Promise<ListChannelsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/channels`, query));
},
async BulkRetrieveChannels(body?: BulkRetrieveChannelsBody): Promise<BulkRetrieveChannelsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/channels/bulk-retrieve`, body ? JSON.stringify(body) : undefined);
},
async RetrieveChannel(channel_id: string): Promise<RetrieveChannelResponse> {
return this.request('GET', `https://connect.squareup.com/v2/channels/${channel_id}`);
},
async ListCustomers(query?: Record<string, string>): Promise<ListCustomersResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers`, query));
},
async CreateCustomer(body?: CreateCustomerBody): Promise<CreateCustomerResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers`, body ? JSON.stringify(body) : undefined);
},
async BulkCreateCustomers(body?: BulkCreateCustomersBody): Promise<BulkCreateCustomersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/bulk-create`, body ? JSON.stringify(body) : undefined);
},
async BulkDeleteCustomers(body?: BulkDeleteCustomersBody): Promise<BulkDeleteCustomersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/bulk-delete`, body ? JSON.stringify(body) : undefined);
},
async BulkRetrieveCustomers(body?: BulkRetrieveCustomersBody): Promise<BulkRetrieveCustomersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/bulk-retrieve`, body ? JSON.stringify(body) : undefined);
},
async BulkUpdateCustomers(body?: BulkUpdateCustomersBody): Promise<BulkUpdateCustomersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/bulk-update`, body ? JSON.stringify(body) : undefined);
},
async ListCustomerCustomAttributeDefinitions(query?: Record<string, string>): Promise<ListCustomerCustomAttributeDefinitionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/custom-attribute-definitions`, query));
},
async CreateCustomerCustomAttributeDefinition(body?: CreateCustomerCustomAttributeDefinitionBody): Promise<CreateCustomerCustomAttributeDefinitionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/custom-attribute-definitions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveCustomerCustomAttributeDefinition(key: string, query?: Record<string, string>): Promise<RetrieveCustomerCustomAttributeDefinitionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/custom-attribute-definitions/${key}`, query));
},
async UpdateCustomerCustomAttributeDefinition(key: string, body?: UpdateCustomerCustomAttributeDefinitionBody): Promise<UpdateCustomerCustomAttributeDefinitionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/customers/custom-attribute-definitions/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteCustomerCustomAttributeDefinition(key: string): Promise<DeleteCustomerCustomAttributeDefinitionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/customers/custom-attribute-definitions/${key}`);
},
async BulkUpsertCustomerCustomAttributes(body?: BulkUpsertCustomerCustomAttributesBody): Promise<BulkUpsertCustomerCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/custom-attributes/bulk-upsert`, body ? JSON.stringify(body) : undefined);
},
async ListCustomerGroups(query?: Record<string, string>): Promise<ListCustomerGroupsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/groups`, query));
},
async CreateCustomerGroup(body?: CreateCustomerGroupBody): Promise<CreateCustomerGroupResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/groups`, body ? JSON.stringify(body) : undefined);
},
async RetrieveCustomerGroup(group_id: string): Promise<RetrieveCustomerGroupResponse> {
return this.request('GET', `https://connect.squareup.com/v2/customers/groups/${group_id}`);
},
async UpdateCustomerGroup(group_id: string, body?: UpdateCustomerGroupBody): Promise<UpdateCustomerGroupResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/customers/groups/${group_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteCustomerGroup(group_id: string): Promise<DeleteCustomerGroupResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/customers/groups/${group_id}`);
},
async SearchCustomers(body?: SearchCustomersBody): Promise<SearchCustomersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/search`, body ? JSON.stringify(body) : undefined);
},
async ListCustomerSegments(query?: Record<string, string>): Promise<ListCustomerSegmentsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/segments`, query));
},
async RetrieveCustomerSegment(segment_id: string): Promise<RetrieveCustomerSegmentResponse> {
return this.request('GET', `https://connect.squareup.com/v2/customers/segments/${segment_id}`);
},
async RetrieveCustomer(customer_id: string): Promise<RetrieveCustomerResponse> {
return this.request('GET', `https://connect.squareup.com/v2/customers/${customer_id}`);
},
async UpdateCustomer(customer_id: string, body?: UpdateCustomerBody): Promise<UpdateCustomerResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/customers/${customer_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteCustomer(customer_id: string, query?: Record<string, string>): Promise<DeleteCustomerResponse> {
return this.request('DELETE', appendQuery(`https://connect.squareup.com/v2/customers/${customer_id}`, query));
},
async CreateCustomerCard(customer_id: string, body?: CreateCustomerCardBody): Promise<CreateCustomerCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/${customer_id}/cards`, body ? JSON.stringify(body) : undefined);
},
async DeleteCustomerCard(customer_id: string, card_id: string): Promise<DeleteCustomerCardResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/customers/${customer_id}/cards/${card_id}`);
},
async ListCustomerCustomAttributes(customer_id: string, query?: Record<string, string>): Promise<ListCustomerCustomAttributesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/${customer_id}/custom-attributes`, query));
},
async RetrieveCustomerCustomAttribute(customer_id: string, key: string, query?: Record<string, string>): Promise<RetrieveCustomerCustomAttributeResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/customers/${customer_id}/custom-attributes/${key}`, query));
},
async UpsertCustomerCustomAttribute(customer_id: string, key: string, body?: UpsertCustomerCustomAttributeBody): Promise<UpsertCustomerCustomAttributeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/customers/${customer_id}/custom-attributes/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteCustomerCustomAttribute(customer_id: string, key: string): Promise<DeleteCustomerCustomAttributeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/customers/${customer_id}/custom-attributes/${key}`);
},
async AddGroupToCustomer(customer_id: string, group_id: string, body?: Record<string, unknown>): Promise<AddGroupToCustomerResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/customers/${customer_id}/groups/${group_id}`, body ? JSON.stringify(body) : undefined);
},
async RemoveGroupFromCustomer(customer_id: string, group_id: string): Promise<RemoveGroupFromCustomerResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/customers/${customer_id}/groups/${group_id}`);
},
async ListDevices(query?: Record<string, string>): Promise<ListDevicesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/devices`, query));
},
async ListDeviceCodes(query?: Record<string, string>): Promise<ListDeviceCodesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/devices/codes`, query));
},
async CreateDeviceCode(body?: CreateDeviceCodeBody): Promise<CreateDeviceCodeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/devices/codes`, body ? JSON.stringify(body) : undefined);
},
async GetDeviceCode(id: string): Promise<GetDeviceCodeResponse> {
return this.request('GET', `https://connect.squareup.com/v2/devices/codes/${id}`);
},
async GetDevice(device_id: string): Promise<GetDeviceResponse> {
return this.request('GET', `https://connect.squareup.com/v2/devices/${device_id}`);
},
async ListDisputes(query?: Record<string, string>): Promise<ListDisputesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/disputes`, query));
},
async RetrieveDispute(dispute_id: string): Promise<RetrieveDisputeResponse> {
return this.request('GET', `https://connect.squareup.com/v2/disputes/${dispute_id}`);
},
async AcceptDispute(dispute_id: string, body?: Record<string, unknown>): Promise<AcceptDisputeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/disputes/${dispute_id}/accept`, body ? JSON.stringify(body) : undefined);
},
async ListDisputeEvidence(dispute_id: string, query?: Record<string, string>): Promise<ListDisputeEvidenceResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/disputes/${dispute_id}/evidence`, query));
},
async CreateDisputeEvidenceFile(dispute_id: string, body?: CreateDisputeEvidenceFileBody): Promise<CreateDisputeEvidenceFileResponse> {
return this.request('POST', `https://connect.squareup.com/v2/disputes/${dispute_id}/evidence-files`, body ? JSON.stringify(body) : undefined);
},
async CreateDisputeEvidenceText(dispute_id: string, body?: CreateDisputeEvidenceTextBody): Promise<CreateDisputeEvidenceTextResponse> {
return this.request('POST', `https://connect.squareup.com/v2/disputes/${dispute_id}/evidence-text`, body ? JSON.stringify(body) : undefined);
},
async RetrieveDisputeEvidence(dispute_id: string, evidence_id: string): Promise<RetrieveDisputeEvidenceResponse> {
return this.request('GET', `https://connect.squareup.com/v2/disputes/${dispute_id}/evidence/${evidence_id}`);
},
async DeleteDisputeEvidence(dispute_id: string, evidence_id: string): Promise<DeleteDisputeEvidenceResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/disputes/${dispute_id}/evidence/${evidence_id}`);
},
async SubmitEvidence(dispute_id: string, body?: Record<string, unknown>): Promise<SubmitEvidenceResponse> {
return this.request('POST', `https://connect.squareup.com/v2/disputes/${dispute_id}/submit-evidence`, body ? JSON.stringify(body) : undefined);
},
async ListEmployees(query?: Record<string, string>): Promise<ListEmployeesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/employees`, query));
},
async RetrieveEmployee(id: string): Promise<RetrieveEmployeeResponse> {
return this.request('GET', `https://connect.squareup.com/v2/employees/${id}`);
},
async SearchEvents(body?: SearchEventsBody): Promise<SearchEventsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/events`, body ? JSON.stringify(body) : undefined);
},
async DisableEvents(body?: Record<string, unknown>): Promise<DisableEventsResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/events/disable`, body ? JSON.stringify(body) : undefined);
},
async EnableEvents(body?: Record<string, unknown>): Promise<EnableEventsResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/events/enable`, body ? JSON.stringify(body) : undefined);
},
async ListEventTypes(query?: Record<string, string>): Promise<ListEventTypesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/events/types`, query));
},
async ListGiftCards(query?: Record<string, string>): Promise<ListGiftCardsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/gift-cards`, query));
},
async CreateGiftCard(body?: CreateGiftCardBody): Promise<CreateGiftCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards`, body ? JSON.stringify(body) : undefined);
},
async ListGiftCardActivities(query?: Record<string, string>): Promise<ListGiftCardActivitiesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/gift-cards/activities`, query));
},
async CreateGiftCardActivity(body?: CreateGiftCardActivityBody): Promise<CreateGiftCardActivityResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards/activities`, body ? JSON.stringify(body) : undefined);
},
async RetrieveGiftCardFromGAN(body?: RetrieveGiftCardFromGANBody): Promise<RetrieveGiftCardFromGANResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards/from-gan`, body ? JSON.stringify(body) : undefined);
},
async RetrieveGiftCardFromNonce(body?: RetrieveGiftCardFromNonceBody): Promise<RetrieveGiftCardFromNonceResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards/from-nonce`, body ? JSON.stringify(body) : undefined);
},
async LinkCustomerToGiftCard(gift_card_id: string, body?: LinkCustomerToGiftCardBody): Promise<LinkCustomerToGiftCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards/${gift_card_id}/link-customer`, body ? JSON.stringify(body) : undefined);
},
async UnlinkCustomerFromGiftCard(gift_card_id: string, body?: UnlinkCustomerFromGiftCardBody): Promise<UnlinkCustomerFromGiftCardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/gift-cards/${gift_card_id}/unlink-customer`, body ? JSON.stringify(body) : undefined);
},
async RetrieveGiftCard(id: string): Promise<RetrieveGiftCardResponse> {
return this.request('GET', `https://connect.squareup.com/v2/gift-cards/${id}`);
},
async DeprecatedRetrieveInventoryAdjustment(adjustment_id: string): Promise<DeprecatedRetrieveInventoryAdjustmentResponse> {
return this.request('GET', `https://connect.squareup.com/v2/inventory/adjustment/${adjustment_id}`);
},
async RetrieveInventoryAdjustment(adjustment_id: string): Promise<RetrieveInventoryAdjustmentResponse> {
return this.request('GET', `https://connect.squareup.com/v2/inventory/adjustments/${adjustment_id}`);
},
async DeprecatedBatchChangeInventory(body?: DeprecatedBatchChangeInventoryBody): Promise<DeprecatedBatchChangeInventoryResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/batch-change`, body ? JSON.stringify(body) : undefined);
},
async DeprecatedBatchRetrieveInventoryChanges(body?: DeprecatedBatchRetrieveInventoryChangesBody): Promise<DeprecatedBatchRetrieveInventoryChangesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/batch-retrieve-changes`, body ? JSON.stringify(body) : undefined);
},
async DeprecatedBatchRetrieveInventoryCounts(body?: DeprecatedBatchRetrieveInventoryCountsBody): Promise<DeprecatedBatchRetrieveInventoryCountsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/batch-retrieve-counts`, body ? JSON.stringify(body) : undefined);
},
async BatchChangeInventory(body?: BatchChangeInventoryBody): Promise<BatchChangeInventoryResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/changes/batch-create`, body ? JSON.stringify(body) : undefined);
},
async BatchRetrieveInventoryChanges(body?: BatchRetrieveInventoryChangesBody): Promise<BatchRetrieveInventoryChangesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/changes/batch-retrieve`, body ? JSON.stringify(body) : undefined);
},
async BatchRetrieveInventoryCounts(body?: BatchRetrieveInventoryCountsBody): Promise<BatchRetrieveInventoryCountsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/inventory/counts/batch-retrieve`, body ? JSON.stringify(body) : undefined);
},
async DeprecatedRetrieveInventoryPhysicalCount(physical_count_id: string): Promise<DeprecatedRetrieveInventoryPhysicalCountResponse> {
return this.request('GET', `https://connect.squareup.com/v2/inventory/physical-count/${physical_count_id}`);
},
async RetrieveInventoryPhysicalCount(physical_count_id: string): Promise<RetrieveInventoryPhysicalCountResponse> {
return this.request('GET', `https://connect.squareup.com/v2/inventory/physical-counts/${physical_count_id}`);
},
async RetrieveInventoryTransfer(transfer_id: string): Promise<RetrieveInventoryTransferResponse> {
return this.request('GET', `https://connect.squareup.com/v2/inventory/transfers/${transfer_id}`);
},
async RetrieveInventoryCount(catalog_object_id: string, query?: Record<string, string>): Promise<RetrieveInventoryCountResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/inventory/${catalog_object_id}`, query));
},
async RetrieveInventoryChanges(catalog_object_id: string, query?: Record<string, string>): Promise<RetrieveInventoryChangesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/inventory/${catalog_object_id}/changes`, query));
},
async ListInvoices(query?: Record<string, string>): Promise<ListInvoicesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/invoices`, query));
},
async CreateInvoice(body?: CreateInvoiceBody): Promise<CreateInvoiceResponse> {
return this.request('POST', `https://connect.squareup.com/v2/invoices`, body ? JSON.stringify(body) : undefined);
},
async SearchInvoices(body?: SearchInvoicesBody): Promise<SearchInvoicesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/invoices/search`, body ? JSON.stringify(body) : undefined);
},
async GetInvoice(invoice_id: string): Promise<GetInvoiceResponse> {
return this.request('GET', `https://connect.squareup.com/v2/invoices/${invoice_id}`);
},
async UpdateInvoice(invoice_id: string, body?: UpdateInvoiceBody): Promise<UpdateInvoiceResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/invoices/${invoice_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteInvoice(invoice_id: string, query?: Record<string, string>): Promise<DeleteInvoiceResponse> {
return this.request('DELETE', appendQuery(`https://connect.squareup.com/v2/invoices/${invoice_id}`, query));
},
async CreateInvoiceAttachment(invoice_id: string, body?: CreateInvoiceAttachmentBody): Promise<CreateInvoiceAttachmentResponse> {
return this.request('POST', `https://connect.squareup.com/v2/invoices/${invoice_id}/attachments`, body ? JSON.stringify(body) : undefined);
},
async DeleteInvoiceAttachment(invoice_id: string, attachment_id: string): Promise<DeleteInvoiceAttachmentResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/invoices/${invoice_id}/attachments/${attachment_id}`);
},
async CancelInvoice(invoice_id: string, body?: CancelInvoiceBody): Promise<CancelInvoiceResponse> {
return this.request('POST', `https://connect.squareup.com/v2/invoices/${invoice_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async PublishInvoice(invoice_id: string, body?: PublishInvoiceBody): Promise<PublishInvoiceResponse> {
return this.request('POST', `https://connect.squareup.com/v2/invoices/${invoice_id}/publish`, body ? JSON.stringify(body) : undefined);
},
async ListBreakTypes(query?: Record<string, string>): Promise<ListBreakTypesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/labor/break-types`, query));
},
async CreateBreakType(body?: CreateBreakTypeBody): Promise<CreateBreakTypeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/break-types`, body ? JSON.stringify(body) : undefined);
},
async GetBreakType(id: string): Promise<GetBreakTypeResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/break-types/${id}`);
},
async UpdateBreakType(id: string, body?: UpdateBreakTypeBody): Promise<UpdateBreakTypeResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/labor/break-types/${id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteBreakType(id: string): Promise<DeleteBreakTypeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/labor/break-types/${id}`);
},
async ListEmployeeWages(query?: Record<string, string>): Promise<ListEmployeeWagesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/labor/employee-wages`, query));
},
async GetEmployeeWage(id: string): Promise<GetEmployeeWageResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/employee-wages/${id}`);
},
async CreateScheduledShift(body?: CreateScheduledShiftBody): Promise<CreateScheduledShiftResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/scheduled-shifts`, body ? JSON.stringify(body) : undefined);
},
async BulkPublishScheduledShifts(body?: BulkPublishScheduledShiftsBody): Promise<BulkPublishScheduledShiftsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/scheduled-shifts/bulk-publish`, body ? JSON.stringify(body) : undefined);
},
async SearchScheduledShifts(body?: SearchScheduledShiftsBody): Promise<SearchScheduledShiftsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/scheduled-shifts/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveScheduledShift(id: string): Promise<RetrieveScheduledShiftResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/scheduled-shifts/${id}`);
},
async UpdateScheduledShift(id: string, body?: UpdateScheduledShiftBody): Promise<UpdateScheduledShiftResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/labor/scheduled-shifts/${id}`, body ? JSON.stringify(body) : undefined);
},
async PublishScheduledShift(id: string, body?: PublishScheduledShiftBody): Promise<PublishScheduledShiftResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/scheduled-shifts/${id}/publish`, body ? JSON.stringify(body) : undefined);
},
async CreateShift(body?: CreateShiftBody): Promise<CreateShiftResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/shifts`, body ? JSON.stringify(body) : undefined);
},
async SearchShifts(body?: SearchShiftsBody): Promise<SearchShiftsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/shifts/search`, body ? JSON.stringify(body) : undefined);
},
async GetShift(id: string): Promise<GetShiftResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/shifts/${id}`);
},
async UpdateShift(id: string, body?: UpdateShiftBody): Promise<UpdateShiftResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/labor/shifts/${id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteShift(id: string): Promise<DeleteShiftResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/labor/shifts/${id}`);
},
async ListTeamMemberWages(query?: Record<string, string>): Promise<ListTeamMemberWagesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/labor/team-member-wages`, query));
},
async GetTeamMemberWage(id: string): Promise<GetTeamMemberWageResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/team-member-wages/${id}`);
},
async CreateTimecard(body?: CreateTimecardBody): Promise<CreateTimecardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/timecards`, body ? JSON.stringify(body) : undefined);
},
async SearchTimecards(body?: SearchTimecardsBody): Promise<SearchTimecardsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/labor/timecards/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveTimecard(id: string): Promise<RetrieveTimecardResponse> {
return this.request('GET', `https://connect.squareup.com/v2/labor/timecards/${id}`);
},
async UpdateTimecard(id: string, body?: UpdateTimecardBody): Promise<UpdateTimecardResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/labor/timecards/${id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteTimecard(id: string): Promise<DeleteTimecardResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/labor/timecards/${id}`);
},
async ListWorkweekConfigs(query?: Record<string, string>): Promise<ListWorkweekConfigsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/labor/workweek-configs`, query));
},
async UpdateWorkweekConfig(id: string, body?: UpdateWorkweekConfigBody): Promise<UpdateWorkweekConfigResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/labor/workweek-configs/${id}`, body ? JSON.stringify(body) : undefined);
},
async ListLocations(): Promise<ListLocationsResponse> {
return this.request('GET', `https://connect.squareup.com/v2/locations`);
},
async CreateLocation(body?: CreateLocationBody): Promise<CreateLocationResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations`, body ? JSON.stringify(body) : undefined);
},
async ListLocationCustomAttributeDefinitions(query?: Record<string, string>): Promise<ListLocationCustomAttributeDefinitionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/locations/custom-attribute-definitions`, query));
},
async CreateLocationCustomAttributeDefinition(body?: CreateLocationCustomAttributeDefinitionBody): Promise<CreateLocationCustomAttributeDefinitionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/custom-attribute-definitions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveLocationCustomAttributeDefinition(key: string, query?: Record<string, string>): Promise<RetrieveLocationCustomAttributeDefinitionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/locations/custom-attribute-definitions/${key}`, query));
},
async UpdateLocationCustomAttributeDefinition(key: string, body?: UpdateLocationCustomAttributeDefinitionBody): Promise<UpdateLocationCustomAttributeDefinitionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/locations/custom-attribute-definitions/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteLocationCustomAttributeDefinition(key: string): Promise<DeleteLocationCustomAttributeDefinitionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/locations/custom-attribute-definitions/${key}`);
},
async BulkDeleteLocationCustomAttributes(body?: BulkDeleteLocationCustomAttributesBody): Promise<BulkDeleteLocationCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/custom-attributes/bulk-delete`, body ? JSON.stringify(body) : undefined);
},
async BulkUpsertLocationCustomAttributes(body?: BulkUpsertLocationCustomAttributesBody): Promise<BulkUpsertLocationCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/custom-attributes/bulk-upsert`, body ? JSON.stringify(body) : undefined);
},
async RetrieveLocation(location_id: string): Promise<RetrieveLocationResponse> {
return this.request('GET', `https://connect.squareup.com/v2/locations/${location_id}`);
},
async UpdateLocation(location_id: string, body?: UpdateLocationBody): Promise<UpdateLocationResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/locations/${location_id}`, body ? JSON.stringify(body) : undefined);
},
async CreateCheckout(location_id: string, body?: CreateCheckoutBody): Promise<CreateCheckoutResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/${location_id}/checkouts`, body ? JSON.stringify(body) : undefined);
},
async ListLocationCustomAttributes(location_id: string, query?: Record<string, string>): Promise<ListLocationCustomAttributesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/locations/${location_id}/custom-attributes`, query));
},
async RetrieveLocationCustomAttribute(location_id: string, key: string, query?: Record<string, string>): Promise<RetrieveLocationCustomAttributeResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/locations/${location_id}/custom-attributes/${key}`, query));
},
async UpsertLocationCustomAttribute(location_id: string, key: string, body?: UpsertLocationCustomAttributeBody): Promise<UpsertLocationCustomAttributeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/${location_id}/custom-attributes/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteLocationCustomAttribute(location_id: string, key: string): Promise<DeleteLocationCustomAttributeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/locations/${location_id}/custom-attributes/${key}`);
},
async ListTransactions(location_id: string, query?: Record<string, string>): Promise<ListTransactionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/locations/${location_id}/transactions`, query));
},
async RetrieveTransaction(location_id: string, transaction_id: string): Promise<RetrieveTransactionResponse> {
return this.request('GET', `https://connect.squareup.com/v2/locations/${location_id}/transactions/${transaction_id}`);
},
async CaptureTransaction(location_id: string, transaction_id: string, body?: Record<string, unknown>): Promise<CaptureTransactionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/${location_id}/transactions/${transaction_id}/capture`, body ? JSON.stringify(body) : undefined);
},
async VoidTransaction(location_id: string, transaction_id: string, body?: Record<string, unknown>): Promise<VoidTransactionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/locations/${location_id}/transactions/${transaction_id}/void`, body ? JSON.stringify(body) : undefined);
},
async CreateLoyaltyAccount(body?: CreateLoyaltyAccountBody): Promise<CreateLoyaltyAccountResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/accounts`, body ? JSON.stringify(body) : undefined);
},
async SearchLoyaltyAccounts(body?: SearchLoyaltyAccountsBody): Promise<SearchLoyaltyAccountsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/accounts/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveLoyaltyAccount(account_id: string): Promise<RetrieveLoyaltyAccountResponse> {
return this.request('GET', `https://connect.squareup.com/v2/loyalty/accounts/${account_id}`);
},
async AccumulateLoyaltyPoints(account_id: string, body?: AccumulateLoyaltyPointsBody): Promise<AccumulateLoyaltyPointsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/accounts/${account_id}/accumulate`, body ? JSON.stringify(body) : undefined);
},
async AdjustLoyaltyPoints(account_id: string, body?: AdjustLoyaltyPointsBody): Promise<AdjustLoyaltyPointsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/accounts/${account_id}/adjust`, body ? JSON.stringify(body) : undefined);
},
async SearchLoyaltyEvents(body?: SearchLoyaltyEventsBody): Promise<SearchLoyaltyEventsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/events/search`, body ? JSON.stringify(body) : undefined);
},
async ListLoyaltyPrograms(): Promise<ListLoyaltyProgramsResponse> {
return this.request('GET', `https://connect.squareup.com/v2/loyalty/programs`);
},
async RetrieveLoyaltyProgram(program_id: string): Promise<RetrieveLoyaltyProgramResponse> {
return this.request('GET', `https://connect.squareup.com/v2/loyalty/programs/${program_id}`);
},
async CalculateLoyaltyPoints(program_id: string, body?: CalculateLoyaltyPointsBody): Promise<CalculateLoyaltyPointsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/programs/${program_id}/calculate`, body ? JSON.stringify(body) : undefined);
},
async ListLoyaltyPromotions(program_id: string, query?: Record<string, string>): Promise<ListLoyaltyPromotionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/loyalty/programs/${program_id}/promotions`, query));
},
async CreateLoyaltyPromotion(program_id: string, body?: CreateLoyaltyPromotionBody): Promise<CreateLoyaltyPromotionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/programs/${program_id}/promotions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveLoyaltyPromotion(promotion_id: string, program_id: string): Promise<RetrieveLoyaltyPromotionResponse> {
return this.request('GET', `https://connect.squareup.com/v2/loyalty/programs/${program_id}/promotions/${promotion_id}`);
},
async CancelLoyaltyPromotion(promotion_id: string, program_id: string, body?: Record<string, unknown>): Promise<CancelLoyaltyPromotionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/programs/${program_id}/promotions/${promotion_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async CreateLoyaltyReward(body?: CreateLoyaltyRewardBody): Promise<CreateLoyaltyRewardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/rewards`, body ? JSON.stringify(body) : undefined);
},
async SearchLoyaltyRewards(body?: SearchLoyaltyRewardsBody): Promise<SearchLoyaltyRewardsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/rewards/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveLoyaltyReward(reward_id: string): Promise<RetrieveLoyaltyRewardResponse> {
return this.request('GET', `https://connect.squareup.com/v2/loyalty/rewards/${reward_id}`);
},
async DeleteLoyaltyReward(reward_id: string): Promise<DeleteLoyaltyRewardResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/loyalty/rewards/${reward_id}`);
},
async RedeemLoyaltyReward(reward_id: string, body?: RedeemLoyaltyRewardBody): Promise<RedeemLoyaltyRewardResponse> {
return this.request('POST', `https://connect.squareup.com/v2/loyalty/rewards/${reward_id}/redeem`, body ? JSON.stringify(body) : undefined);
},
async ListMerchants(query?: Record<string, string>): Promise<ListMerchantsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/merchants`, query));
},
async ListMerchantCustomAttributeDefinitions(query?: Record<string, string>): Promise<ListMerchantCustomAttributeDefinitionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/merchants/custom-attribute-definitions`, query));
},
async CreateMerchantCustomAttributeDefinition(body?: CreateMerchantCustomAttributeDefinitionBody): Promise<CreateMerchantCustomAttributeDefinitionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/merchants/custom-attribute-definitions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveMerchantCustomAttributeDefinition(key: string, query?: Record<string, string>): Promise<RetrieveMerchantCustomAttributeDefinitionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/merchants/custom-attribute-definitions/${key}`, query));
},
async UpdateMerchantCustomAttributeDefinition(key: string, body?: UpdateMerchantCustomAttributeDefinitionBody): Promise<UpdateMerchantCustomAttributeDefinitionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/merchants/custom-attribute-definitions/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteMerchantCustomAttributeDefinition(key: string): Promise<DeleteMerchantCustomAttributeDefinitionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/merchants/custom-attribute-definitions/${key}`);
},
async BulkDeleteMerchantCustomAttributes(body?: BulkDeleteMerchantCustomAttributesBody): Promise<BulkDeleteMerchantCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/merchants/custom-attributes/bulk-delete`, body ? JSON.stringify(body) : undefined);
},
async BulkUpsertMerchantCustomAttributes(body?: BulkUpsertMerchantCustomAttributesBody): Promise<BulkUpsertMerchantCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/merchants/custom-attributes/bulk-upsert`, body ? JSON.stringify(body) : undefined);
},
async RetrieveMerchant(merchant_id: string): Promise<RetrieveMerchantResponse> {
return this.request('GET', `https://connect.squareup.com/v2/merchants/${merchant_id}`);
},
async ListMerchantCustomAttributes(merchant_id: string, query?: Record<string, string>): Promise<ListMerchantCustomAttributesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/merchants/${merchant_id}/custom-attributes`, query));
},
async RetrieveMerchantCustomAttribute(merchant_id: string, key: string, query?: Record<string, string>): Promise<RetrieveMerchantCustomAttributeResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/merchants/${merchant_id}/custom-attributes/${key}`, query));
},
async UpsertMerchantCustomAttribute(merchant_id: string, key: string, body?: UpsertMerchantCustomAttributeBody): Promise<UpsertMerchantCustomAttributeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/merchants/${merchant_id}/custom-attributes/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteMerchantCustomAttribute(merchant_id: string, key: string): Promise<DeleteMerchantCustomAttributeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/merchants/${merchant_id}/custom-attributes/${key}`);
},
async RetrieveLocationSettings(location_id: string): Promise<RetrieveLocationSettingsResponse> {
return this.request('GET', `https://connect.squareup.com/v2/online-checkout/location-settings/${location_id}`);
},
async UpdateLocationSettings(location_id: string, body?: UpdateLocationSettingsBody): Promise<UpdateLocationSettingsResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/online-checkout/location-settings/${location_id}`, body ? JSON.stringify(body) : undefined);
},
async RetrieveMerchantSettings(): Promise<RetrieveMerchantSettingsResponse> {
return this.request('GET', `https://connect.squareup.com/v2/online-checkout/merchant-settings`);
},
async UpdateMerchantSettings(body?: UpdateMerchantSettingsBody): Promise<UpdateMerchantSettingsResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/online-checkout/merchant-settings`, body ? JSON.stringify(body) : undefined);
},
async ListPaymentLinks(query?: Record<string, string>): Promise<ListPaymentLinksResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/online-checkout/payment-links`, query));
},
async CreatePaymentLink(body?: CreatePaymentLinkBody): Promise<CreatePaymentLinkResponse> {
return this.request('POST', `https://connect.squareup.com/v2/online-checkout/payment-links`, body ? JSON.stringify(body) : undefined);
},
async RetrievePaymentLink(id: string): Promise<RetrievePaymentLinkResponse> {
return this.request('GET', `https://connect.squareup.com/v2/online-checkout/payment-links/${id}`);
},
async UpdatePaymentLink(id: string, body?: UpdatePaymentLinkBody): Promise<UpdatePaymentLinkResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/online-checkout/payment-links/${id}`, body ? JSON.stringify(body) : undefined);
},
async DeletePaymentLink(id: string): Promise<DeletePaymentLinkResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/online-checkout/payment-links/${id}`);
},
async CreateOrder(body?: CreateOrderBody): Promise<CreateOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders`, body ? JSON.stringify(body) : undefined);
},
async BatchRetrieveOrders(body?: BatchRetrieveOrdersBody): Promise<BatchRetrieveOrdersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/batch-retrieve`, body ? JSON.stringify(body) : undefined);
},
async CalculateOrder(body?: CalculateOrderBody): Promise<CalculateOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/calculate`, body ? JSON.stringify(body) : undefined);
},
async CloneOrder(body?: CloneOrderBody): Promise<CloneOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/clone`, body ? JSON.stringify(body) : undefined);
},
async ListOrderCustomAttributeDefinitions(query?: Record<string, string>): Promise<ListOrderCustomAttributeDefinitionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/orders/custom-attribute-definitions`, query));
},
async CreateOrderCustomAttributeDefinition(body?: CreateOrderCustomAttributeDefinitionBody): Promise<CreateOrderCustomAttributeDefinitionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/custom-attribute-definitions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveOrderCustomAttributeDefinition(key: string, query?: Record<string, string>): Promise<RetrieveOrderCustomAttributeDefinitionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/orders/custom-attribute-definitions/${key}`, query));
},
async UpdateOrderCustomAttributeDefinition(key: string, body?: UpdateOrderCustomAttributeDefinitionBody): Promise<UpdateOrderCustomAttributeDefinitionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/orders/custom-attribute-definitions/${key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteOrderCustomAttributeDefinition(key: string): Promise<DeleteOrderCustomAttributeDefinitionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/orders/custom-attribute-definitions/${key}`);
},
async BulkDeleteOrderCustomAttributes(body?: BulkDeleteOrderCustomAttributesBody): Promise<BulkDeleteOrderCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/custom-attributes/bulk-delete`, body ? JSON.stringify(body) : undefined);
},
async BulkUpsertOrderCustomAttributes(body?: BulkUpsertOrderCustomAttributesBody): Promise<BulkUpsertOrderCustomAttributesResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/custom-attributes/bulk-upsert`, body ? JSON.stringify(body) : undefined);
},
async SearchOrders(body?: SearchOrdersBody): Promise<SearchOrdersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveOrder(order_id: string): Promise<RetrieveOrderResponse> {
return this.request('GET', `https://connect.squareup.com/v2/orders/${order_id}`);
},
async UpdateOrder(order_id: string, body?: UpdateOrderBody): Promise<UpdateOrderResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/orders/${order_id}`, body ? JSON.stringify(body) : undefined);
},
async ListOrderCustomAttributes(order_id: string, query?: Record<string, string>): Promise<ListOrderCustomAttributesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/orders/${order_id}/custom-attributes`, query));
},
async RetrieveOrderCustomAttribute(order_id: string, custom_attribute_key: string, query?: Record<string, string>): Promise<RetrieveOrderCustomAttributeResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/orders/${order_id}/custom-attributes/${custom_attribute_key}`, query));
},
async UpsertOrderCustomAttribute(order_id: string, custom_attribute_key: string, body?: UpsertOrderCustomAttributeBody): Promise<UpsertOrderCustomAttributeResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/${order_id}/custom-attributes/${custom_attribute_key}`, body ? JSON.stringify(body) : undefined);
},
async DeleteOrderCustomAttribute(order_id: string, custom_attribute_key: string): Promise<DeleteOrderCustomAttributeResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/orders/${order_id}/custom-attributes/${custom_attribute_key}`);
},
async PayOrder(order_id: string, body?: PayOrderBody): Promise<PayOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/orders/${order_id}/pay`, body ? JSON.stringify(body) : undefined);
},
async ListPayments(query?: Record<string, string>): Promise<ListPaymentsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/payments`, query));
},
async CreatePayment(body?: CreatePaymentBody): Promise<CreatePaymentResponse> {
return this.request('POST', `https://connect.squareup.com/v2/payments`, body ? JSON.stringify(body) : undefined);
},
async CancelPaymentByIdempotencyKey(body?: CancelPaymentByIdempotencyKeyBody): Promise<CancelPaymentByIdempotencyKeyResponse> {
return this.request('POST', `https://connect.squareup.com/v2/payments/cancel`, body ? JSON.stringify(body) : undefined);
},
async GetPayment(payment_id: string): Promise<GetPaymentResponse> {
return this.request('GET', `https://connect.squareup.com/v2/payments/${payment_id}`);
},
async UpdatePayment(payment_id: string, body?: UpdatePaymentBody): Promise<UpdatePaymentResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/payments/${payment_id}`, body ? JSON.stringify(body) : undefined);
},
async CancelPayment(payment_id: string, body?: Record<string, unknown>): Promise<CancelPaymentResponse> {
return this.request('POST', `https://connect.squareup.com/v2/payments/${payment_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async CompletePayment(payment_id: string, body?: CompletePaymentBody): Promise<CompletePaymentResponse> {
return this.request('POST', `https://connect.squareup.com/v2/payments/${payment_id}/complete`, body ? JSON.stringify(body) : undefined);
},
async ListPayouts(query?: Record<string, string>): Promise<ListPayoutsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/payouts`, query));
},
async GetPayout(payout_id: string): Promise<GetPayoutResponse> {
return this.request('GET', `https://connect.squareup.com/v2/payouts/${payout_id}`);
},
async ListPayoutEntries(payout_id: string, query?: Record<string, string>): Promise<ListPayoutEntriesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/payouts/${payout_id}/payout-entries`, query));
},
async ListPaymentRefunds(query?: Record<string, string>): Promise<ListPaymentRefundsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/refunds`, query));
},
async RefundPayment(body?: RefundPaymentBody): Promise<RefundPaymentResponse> {
return this.request('POST', `https://connect.squareup.com/v2/refunds`, body ? JSON.stringify(body) : undefined);
},
async GetPaymentRefund(refund_id: string): Promise<GetPaymentRefundResponse> {
return this.request('GET', `https://connect.squareup.com/v2/refunds/${refund_id}`);
},
async ListSites(): Promise<ListSitesResponse> {
return this.request('GET', `https://connect.squareup.com/v2/sites`);
},
async RetrieveSnippet(site_id: string): Promise<RetrieveSnippetResponse> {
return this.request('GET', `https://connect.squareup.com/v2/sites/${site_id}/snippet`);
},
async UpsertSnippet(site_id: string, body?: UpsertSnippetBody): Promise<UpsertSnippetResponse> {
return this.request('POST', `https://connect.squareup.com/v2/sites/${site_id}/snippet`, body ? JSON.stringify(body) : undefined);
},
async DeleteSnippet(site_id: string): Promise<DeleteSnippetResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/sites/${site_id}/snippet`);
},
async CreateSubscription(body?: CreateSubscriptionBody): Promise<CreateSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions`, body ? JSON.stringify(body) : undefined);
},
async BulkSwapPlan(body?: BulkSwapPlanBody): Promise<BulkSwapPlanResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/bulk-swap-plan`, body ? JSON.stringify(body) : undefined);
},
async SearchSubscriptions(body?: SearchSubscriptionsBody): Promise<SearchSubscriptionsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveSubscription(subscription_id: string, query?: Record<string, string>): Promise<RetrieveSubscriptionResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/subscriptions/${subscription_id}`, query));
},
async UpdateSubscription(subscription_id: string, body?: UpdateSubscriptionBody): Promise<UpdateSubscriptionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/subscriptions/${subscription_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteSubscriptionAction(subscription_id: string, action_id: string): Promise<DeleteSubscriptionActionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/actions/${action_id}`);
},
async ChangeBillingAnchorDate(subscription_id: string, body?: ChangeBillingAnchorDateBody): Promise<ChangeBillingAnchorDateResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/billing-anchor`, body ? JSON.stringify(body) : undefined);
},
async CancelSubscription(subscription_id: string, body?: Record<string, unknown>): Promise<CancelSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async ListSubscriptionEvents(subscription_id: string, query?: Record<string, string>): Promise<ListSubscriptionEventsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/subscriptions/${subscription_id}/events`, query));
},
async PauseSubscription(subscription_id: string, body?: PauseSubscriptionBody): Promise<PauseSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/pause`, body ? JSON.stringify(body) : undefined);
},
async ResumeSubscription(subscription_id: string, body?: ResumeSubscriptionBody): Promise<ResumeSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/resume`, body ? JSON.stringify(body) : undefined);
},
async SwapPlan(subscription_id: string, body?: SwapPlanBody): Promise<SwapPlanResponse> {
return this.request('POST', `https://connect.squareup.com/v2/subscriptions/${subscription_id}/swap-plan`, body ? JSON.stringify(body) : undefined);
},
async CreateTeamMember(body?: CreateTeamMemberBody): Promise<CreateTeamMemberResponse> {
return this.request('POST', `https://connect.squareup.com/v2/team-members`, body ? JSON.stringify(body) : undefined);
},
async BulkCreateTeamMembers(body?: BulkCreateTeamMembersBody): Promise<BulkCreateTeamMembersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/team-members/bulk-create`, body ? JSON.stringify(body) : undefined);
},
async BulkUpdateTeamMembers(body?: BulkUpdateTeamMembersBody): Promise<BulkUpdateTeamMembersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/team-members/bulk-update`, body ? JSON.stringify(body) : undefined);
},
async ListJobs(query?: Record<string, string>): Promise<ListJobsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/team-members/jobs`, query));
},
async CreateJob(body?: CreateJobBody): Promise<CreateJobResponse> {
return this.request('POST', `https://connect.squareup.com/v2/team-members/jobs`, body ? JSON.stringify(body) : undefined);
},
async RetrieveJob(job_id: string): Promise<RetrieveJobResponse> {
return this.request('GET', `https://connect.squareup.com/v2/team-members/jobs/${job_id}`);
},
async UpdateJob(job_id: string, body?: UpdateJobBody): Promise<UpdateJobResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/team-members/jobs/${job_id}`, body ? JSON.stringify(body) : undefined);
},
async SearchTeamMembers(body?: SearchTeamMembersBody): Promise<SearchTeamMembersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/team-members/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveTeamMember(team_member_id: string): Promise<RetrieveTeamMemberResponse> {
return this.request('GET', `https://connect.squareup.com/v2/team-members/${team_member_id}`);
},
async UpdateTeamMember(team_member_id: string, body?: UpdateTeamMemberBody): Promise<UpdateTeamMemberResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/team-members/${team_member_id}`, body ? JSON.stringify(body) : undefined);
},
async RetrieveWageSetting(team_member_id: string): Promise<RetrieveWageSettingResponse> {
return this.request('GET', `https://connect.squareup.com/v2/team-members/${team_member_id}/wage-setting`);
},
async UpdateWageSetting(team_member_id: string, body?: UpdateWageSettingBody): Promise<UpdateWageSettingResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/team-members/${team_member_id}/wage-setting`, body ? JSON.stringify(body) : undefined);
},
async CreateTerminalAction(body?: CreateTerminalActionBody): Promise<CreateTerminalActionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/actions`, body ? JSON.stringify(body) : undefined);
},
async SearchTerminalActions(body?: SearchTerminalActionsBody): Promise<SearchTerminalActionsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/actions/search`, body ? JSON.stringify(body) : undefined);
},
async GetTerminalAction(action_id: string): Promise<GetTerminalActionResponse> {
return this.request('GET', `https://connect.squareup.com/v2/terminals/actions/${action_id}`);
},
async CancelTerminalAction(action_id: string, body?: Record<string, unknown>): Promise<CancelTerminalActionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/actions/${action_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async DismissTerminalAction(action_id: string, body?: Record<string, unknown>): Promise<DismissTerminalActionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/actions/${action_id}/dismiss`, body ? JSON.stringify(body) : undefined);
},
async CreateTerminalCheckout(body?: CreateTerminalCheckoutBody): Promise<CreateTerminalCheckoutResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/checkouts`, body ? JSON.stringify(body) : undefined);
},
async SearchTerminalCheckouts(body?: SearchTerminalCheckoutsBody): Promise<SearchTerminalCheckoutsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/checkouts/search`, body ? JSON.stringify(body) : undefined);
},
async GetTerminalCheckout(checkout_id: string): Promise<GetTerminalCheckoutResponse> {
return this.request('GET', `https://connect.squareup.com/v2/terminals/checkouts/${checkout_id}`);
},
async CancelTerminalCheckout(checkout_id: string, body?: Record<string, unknown>): Promise<CancelTerminalCheckoutResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/checkouts/${checkout_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async DismissTerminalCheckout(checkout_id: string, body?: Record<string, unknown>): Promise<DismissTerminalCheckoutResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/checkouts/${checkout_id}/dismiss`, body ? JSON.stringify(body) : undefined);
},
async CreateTerminalRefund(body?: CreateTerminalRefundBody): Promise<CreateTerminalRefundResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/refunds`, body ? JSON.stringify(body) : undefined);
},
async SearchTerminalRefunds(body?: SearchTerminalRefundsBody): Promise<SearchTerminalRefundsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/refunds/search`, body ? JSON.stringify(body) : undefined);
},
async GetTerminalRefund(terminal_refund_id: string): Promise<GetTerminalRefundResponse> {
return this.request('GET', `https://connect.squareup.com/v2/terminals/refunds/${terminal_refund_id}`);
},
async CancelTerminalRefund(terminal_refund_id: string, body?: Record<string, unknown>): Promise<CancelTerminalRefundResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/refunds/${terminal_refund_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async DismissTerminalRefund(terminal_refund_id: string, body?: Record<string, unknown>): Promise<DismissTerminalRefundResponse> {
return this.request('POST', `https://connect.squareup.com/v2/terminals/refunds/${terminal_refund_id}/dismiss`, body ? JSON.stringify(body) : undefined);
},
async CreateTransferOrder(body?: CreateTransferOrderBody): Promise<CreateTransferOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/transfer-orders`, body ? JSON.stringify(body) : undefined);
},
async SearchTransferOrders(body?: SearchTransferOrdersBody): Promise<SearchTransferOrdersResponse> {
return this.request('POST', `https://connect.squareup.com/v2/transfer-orders/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveTransferOrder(transfer_order_id: string): Promise<RetrieveTransferOrderResponse> {
return this.request('GET', `https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}`);
},
async UpdateTransferOrder(transfer_order_id: string, body?: UpdateTransferOrderBody): Promise<UpdateTransferOrderResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteTransferOrder(transfer_order_id: string, query?: Record<string, string>): Promise<DeleteTransferOrderResponse> {
return this.request('DELETE', appendQuery(`https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}`, query));
},
async CancelTransferOrder(transfer_order_id: string, body?: CancelTransferOrderBody): Promise<CancelTransferOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}/cancel`, body ? JSON.stringify(body) : undefined);
},
async ReceiveTransferOrder(transfer_order_id: string, body?: ReceiveTransferOrderBody): Promise<ReceiveTransferOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}/receive`, body ? JSON.stringify(body) : undefined);
},
async StartTransferOrder(transfer_order_id: string, body?: StartTransferOrderBody): Promise<StartTransferOrderResponse> {
return this.request('POST', `https://connect.squareup.com/v2/transfer-orders/${transfer_order_id}/start`, body ? JSON.stringify(body) : undefined);
},
async BulkCreateVendors(body?: BulkCreateVendorsBody): Promise<BulkCreateVendorsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/vendors/bulk-create`, body ? JSON.stringify(body) : undefined);
},
async BulkRetrieveVendors(body?: BulkRetrieveVendorsBody): Promise<BulkRetrieveVendorsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/vendors/bulk-retrieve`, body ? JSON.stringify(body) : undefined);
},
async BulkUpdateVendors(body?: BulkUpdateVendorsBody): Promise<BulkUpdateVendorsResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/vendors/bulk-update`, body ? JSON.stringify(body) : undefined);
},
async CreateVendor(body?: CreateVendorBody): Promise<CreateVendorResponse> {
return this.request('POST', `https://connect.squareup.com/v2/vendors/create`, body ? JSON.stringify(body) : undefined);
},
async SearchVendors(body?: SearchVendorsBody): Promise<SearchVendorsResponse> {
return this.request('POST', `https://connect.squareup.com/v2/vendors/search`, body ? JSON.stringify(body) : undefined);
},
async RetrieveVendor(vendor_id: string): Promise<RetrieveVendorResponse> {
return this.request('GET', `https://connect.squareup.com/v2/vendors/${vendor_id}`);
},
async UpdateVendor(body?: UpdateVendorBody): Promise<UpdateVendorResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/vendors/${vendor_id}`, body ? JSON.stringify(body) : undefined);
},
async ListWebhookEventTypes(query?: Record<string, string>): Promise<ListWebhookEventTypesResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/webhooks/event-types`, query));
},
async ListWebhookSubscriptions(query?: Record<string, string>): Promise<ListWebhookSubscriptionsResponse> {
return this.request('GET', appendQuery(`https://connect.squareup.com/v2/webhooks/subscriptions`, query));
},
async CreateWebhookSubscription(body?: CreateWebhookSubscriptionBody): Promise<CreateWebhookSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/webhooks/subscriptions`, body ? JSON.stringify(body) : undefined);
},
async RetrieveWebhookSubscription(subscription_id: string): Promise<RetrieveWebhookSubscriptionResponse> {
return this.request('GET', `https://connect.squareup.com/v2/webhooks/subscriptions/${subscription_id}`);
},
async UpdateWebhookSubscription(subscription_id: string, body?: UpdateWebhookSubscriptionBody): Promise<UpdateWebhookSubscriptionResponse> {
return this.request('PUT', `https://connect.squareup.com/v2/webhooks/subscriptions/${subscription_id}`, body ? JSON.stringify(body) : undefined);
},
async DeleteWebhookSubscription(subscription_id: string): Promise<DeleteWebhookSubscriptionResponse> {
return this.request('DELETE', `https://connect.squareup.com/v2/webhooks/subscriptions/${subscription_id}`);
},
async UpdateWebhookSubscriptionSignatureKey(subscription_id: string, body?: UpdateWebhookSubscriptionSignatureKeyBody): Promise<UpdateWebhookSubscriptionSignatureKeyResponse> {
return this.request('POST', `https://connect.squareup.com/v2/webhooks/subscriptions/${subscription_id}/signature-key`, body ? JSON.stringify(body) : undefined);
},
async TestWebhookSubscription(subscription_id: string, body?: TestWebhookSubscriptionBody): Promise<TestWebhookSubscriptionResponse> {
return this.request('POST', `https://connect.squareup.com/v2/webhooks/subscriptions/${subscription_id}/test`, body ? JSON.stringify(body) : undefined);
},
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |