Class: Lithic::Resources::CardBulkOrders

Inherits:
Object
  • Object
show all
Defined in:
lib/lithic/resources/card_bulk_orders.rb

Instance Method Summary collapse

Constructor Details

#initialize(client:) ⇒ CardBulkOrders

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

Parameters:



122
123
124
# File 'lib/lithic/resources/card_bulk_orders.rb', line 122

def initialize(client:)
  @client = client
end

Instance Method Details

#create(customer_product_id:, shipping_address:, shipping_method:, request_options: {}) ⇒ Lithic::Models::CardBulkOrder

Some parameter documentations has been truncated, see Models::CardBulkOrderCreateParams for more details.

Create a new bulk order for physical card shipments [BETA]. Cards can be added to the order via the POST /v1/cards endpoint by specifying the bulk_order_token. Lock the order via PATCH /v1/card_bulk_orders/bulk_order_token to prepare for shipment. Please work with your Customer Success Manager and card personalization bureau to ensure bulk shipping is supported for your program.

Parameters:

  • customer_product_id (String)

    Customer-specified product configuration for physical card manufacturing. This m

  • shipping_address (Object)

    Shipping address for all cards in this bulk order

  • shipping_method (Symbol, Lithic::Models::CardBulkOrderCreateParams::ShippingMethod)

    Shipping method for all cards in this bulk order

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



29
30
31
32
33
34
35
36
37
38
# File 'lib/lithic/resources/card_bulk_orders.rb', line 29

def create(params)
  parsed, options = Lithic::CardBulkOrderCreateParams.dump_request(params)
  @client.request(
    method: :post,
    path: "v1/card_bulk_orders",
    body: parsed,
    model: Lithic::CardBulkOrder,
    options: options
  )
end

#list(begin_: nil, end_: nil, ending_before: nil, page_size: nil, starting_after: nil, request_options: {}) ⇒ Lithic::Internal::CursorPage<Lithic::Models::CardBulkOrder>

Some parameter documentations has been truncated, see Models::CardBulkOrderListParams for more details.

List bulk orders for physical card shipments [BETA]

Parameters:

  • begin_ (Time)

    Date string in RFC 3339 format. Only entries created after the specified time wi

  • end_ (Time)

    Date string in RFC 3339 format. Only entries created before the specified time w

  • ending_before (String)

    A cursor representing an item’s token before which a page of results should end.

  • page_size (Integer)

    Page size (for pagination).

  • starting_after (String)

    A cursor representing an item’s token after which a page of results should begin

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



107
108
109
110
111
112
113
114
115
116
117
# File 'lib/lithic/resources/card_bulk_orders.rb', line 107

def list(params = {})
  parsed, options = Lithic::CardBulkOrderListParams.dump_request(params)
  @client.request(
    method: :get,
    path: "v1/card_bulk_orders",
    query: parsed.transform_keys(begin_: "begin", end_: "end"),
    page: Lithic::Internal::CursorPage,
    model: Lithic::CardBulkOrder,
    options: options
  )
end

#retrieve(bulk_order_token, request_options: {}) ⇒ Lithic::Models::CardBulkOrder

Retrieve a specific bulk order by token [BETA]

Parameters:

  • bulk_order_token (String)

    Globally unique identifier for the bulk order

  • request_options (Lithic::RequestOptions, Hash{Symbol=>Object}, nil)

Returns:

See Also:



51
52
53
54
55
56
57
58
# File 'lib/lithic/resources/card_bulk_orders.rb', line 51

def retrieve(bulk_order_token, params = {})
  @client.request(
    method: :get,
    path: ["v1/card_bulk_orders/%1$s", bulk_order_token],
    model: Lithic::CardBulkOrder,
    options: params[:request_options]
  )
end

#update(bulk_order_token, status:, request_options: {}) ⇒ Lithic::Models::CardBulkOrder

Update a bulk order [BETA]. Primarily used to lock the order, preventing additional cards from being added

Parameters:

Returns:

See Also:



74
75
76
77
78
79
80
81
82
83
# File 'lib/lithic/resources/card_bulk_orders.rb', line 74

def update(bulk_order_token, params)
  parsed, options = Lithic::CardBulkOrderUpdateParams.dump_request(params)
  @client.request(
    method: :patch,
    path: ["v1/card_bulk_orders/%1$s", bulk_order_token],
    body: parsed,
    model: Lithic::CardBulkOrder,
    options: options
  )
end