module Drip::Client::Orders
Public Instance Methods
create_or_update_order(email, options = {})
click to toggle source
Public: Create or update an order.
email - Required. The String email address of the subscriber. options - Required. A Hash of additional order options. Refer to the
Drip API docs for the required schema.
Returns a Drip::Response
. See developer.drip.com/#orders
# File lib/drip/client/orders.rb, line 14 def create_or_update_order(email, options = {}) data = options.merge(email: email) make_json_api_request :post, "v2/#{account_id}/orders", private_generate_resource("orders", data) end
create_or_update_orders(orders)
click to toggle source
Public: Create or update a batch of orders.
orders - Required. An Array with between 1 and 1000 objects containing order data
Returns a Drip::Response
. See developer.drip.com/#create-or-update-a-batch-of-orders
# File lib/drip/client/orders.rb, line 25 def create_or_update_orders(orders) make_json_api_request :post, "v2/#{account_id}/orders/batches", private_generate_resource("batches", { "orders" => orders }) end
create_or_update_refund(options)
click to toggle source
Public: Create or update a refund.
options - Required. A Hash of refund properties
amount - Required. The amount of the refund. provider - Required. The provider for the Order being refunded. order_upstream_id - Required. The upstream_id for the Order being refunded. upstream_id - The unique id of refund in the order management system. note - A note about the refund. processed_at - The String time at which the refund was processed in ISO-8601 format.
Returns a Drip::Response
. See developer.drip.com/#create-or-update-a-refund
# File lib/drip/client/orders.rb, line 42 def create_or_update_refund(options) make_json_api_request :post, "v2/#{account_id}/refunds", private_generate_resource("refunds", options) end