Class: Amocrm::Resources::CustomerBonusPoints

Inherits:
Object
  • Object
show all
Defined in:
lib/amocrm/resources/customer_bonus_points.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CustomerBonusPoints

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of CustomerBonusPoints.

Parameters:



31
32
33
# File 'lib/amocrm/resources/customer_bonus_points.rb', line 31

def initialize(client:)
  @client = client
end

Instance Method Details

#change(customer_id, body:, request_options: {}) ⇒ Amocrm::Models::CustomerBonusPointChangeResponse::CustomerBonusPointsResponse, Amocrm::Models::CustomerBonusPointChangeResponse::Problem

Earn or redeem bonus points.



17
18
19
20
21
22
23
24
25
26
# File 'lib/amocrm/resources/customer_bonus_points.rb', line 17

def change(customer_id, params)
  parsed, options = Amocrm::CustomerBonusPointChangeParams.dump_request(params)
  @client.request(
    method: :post,
    path: ["api/v4/customers/%1$s/bonus_points", customer_id],
    body: parsed[:body],
    model: Amocrm::Models::CustomerBonusPointChangeResponse,
    options: options
  )
end