Module: Square::APIOperations::Delete

Included in:
Category, Discount, Fee, Item, Variation
Defined in:
lib/square/api_operations/delete.rb

Instance Method Summary collapse

Instance Method Details

#delete(*args, params) ⇒ #to_json

Delete a resource.

Parameters:

  • id (String)

    ID of the resource to update.

  • parent_id (String)

    ID of the ‘parent’ to update. Optional.

  • params (Hash)

    Payload. Optional.

Returns:

  • (#to_json)


11
12
13
14
15
16
17
18
19
20
21
# File 'lib/square/api_operations/delete.rb', line 11

def delete(*args, params)
  id, parent_id = args

  response = Square.make_request(
    method: 'DELETE',
    endpoint: self.generate_endpoint_url(id, parent_id),
    payload: params
  )

  Square.parse_response(response)
end