Class: DeliveryFivePostClient::Resources::API::V3::Partners::Orders

Inherits:
Object
  • Object
show all
Defined in:
lib/delivery_five_post_client/resources/api/v3/partners/orders.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ Orders

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 Orders.

Parameters:



68
69
70
# File 'lib/delivery_five_post_client/resources/api/v3/partners/orders.rb', line 68

def initialize(client:)
  @client = client
end

Instance Method Details

#cancel_order(order_id, request_options: {}) ⇒ nil

Отмена заказа / Cancel order

Parameters:

Returns:

  • (nil)

See Also:



20
21
22
23
24
25
26
27
# File 'lib/delivery_five_post_client/resources/api/v3/partners/orders.rb', line 20

def cancel_order(order_id, params = {})
  @client.request(
    method: :delete,
    path: ["api/v3/partners/orders/%1$s", order_id],
    model: NilClass,
    options: params[:request_options]
  )
end

#create_order(cargoes:, client:, cost:, receiver:, sender_order_id:, warehouse:, brand_name: nil, client_order_id: nil, request_options: {}) ⇒ DeliveryFivePostClient::Models::API::V1::OrderCreateResponse

Универсальное создание заказа / Universal order creation

Parameters:

Returns:

See Also:



54
55
56
57
58
59
60
61
62
63
# File 'lib/delivery_five_post_client/resources/api/v3/partners/orders.rb', line 54

def create_order(params)
  parsed, options = DeliveryFivePostClient::API::V3::Partners::OrderCreateOrderParams.dump_request(params)
  @client.request(
    method: :post,
    path: "api/v3/partners/orders",
    body: parsed,
    model: DeliveryFivePostClient::API::V1::OrderCreateResponse,
    options: options
  )
end