Class: StickyIoRestfulApiV2025731::LineItemManagementController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb

Overview

LineItemManagementController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#update_next_recurring_date(body, domain, v2_ext) ⇒ ApiResponse

Update the next recurring date for one or more line items in a subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ——— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | date | Required | - | String | The next recurring date in YYYY-MM-DD format. Must be greater than the day of the request. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples\ Update next recurring date by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29229,
"date": "2021-12-10"

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "40d5282d19e4a6f9a9ac2e0e7113e683",
        "ce6f12061175ea4cb86dd2a23feebd8c"
    ],
    "update_type": "Next Recurring Date",
    "new_value": "2021-12-10"
}

} “‘ Update next recurring date by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "ce6f12061175ea4cb86dd2a23feebd8c",
"date": "2021-12-15"

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "ce6f12061175ea4cb86dd2a23feebd8c"
    ],
    "update_type": "Next Recurring Date",
    "new_value": "2021-12-15"
}

} “‘ Update next recurring date by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29229,
"product_id": 24,
"date": "2021-12-09"

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "ce6f12061175ea4cb86dd2a23feebd8c"
    ],
    "update_type": "Next Recurring Date",
    "new_value": "2021-12-09"
}

} “‘ Update next recurring date by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29219,
"variant_id": 6,
"date": "2021-12-21"

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "640122fc14de0cb059572861346b8ab6"
    ],
    "update_type": "Next Recurring Date",
    "new_value": "2021-12-21"
}

} “‘ type description here

Parameters:

  • body (UpdateNextRecurringDateRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 131

def update_next_recurring_date(body,
                               domain,
                               v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/next-recurring-date',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_next_recurring_price(body, domain, v2_ext) ⇒ ApiResponse

Update the next recurring price for one or more line items in a subscription. Preservation will be defaulted to ON when ‘is_preserve` is not passed. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ———— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | price | Required | - | Float | The next recurring price. | | is_preserve | Optional | 1 | Integer Flag | The next recurring price preservation flag. Defaulted to 1. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples Update the next recurring price by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29249,
"price": 12.99

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404",
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Next Recurring Price",
    "new_value": "12.99"
}

} “‘ Update the next recurring price by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "225c0c4f0948f4ee7ba86b481580dd76",
"price": 13.98

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Next Recurring Price",
    "new_value": "13.98"
}

} “‘ Update the next recurring price by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29249,
"product_id": 12,
"price": 2.99

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404",
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Next Recurring Price",
    "new_value": "2.99"
}

} “‘ Update the next recurring price by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29249,
"variant_id": 6,
"price": 12.99

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Next Recurring Price",
    "new_value": "12.99"
}

} “‘ type description here

Parameters:

  • body (UpdateNextRecurringPriceRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 805

def update_next_recurring_price(body,
                                domain,
                                v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/next-recurring-price',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_next_recurring_product(body, domain, v2_ext) ⇒ ApiResponse

Update the next recurring product/variant for one or more line items in a subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| ———————- | ———– | ——- | ——— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | next_recurring_product | Conditional | - | Integer | The next recurring product. Required when `next_recurring_variant` is not provided. | | next_recurring_variant | Conditional | - | Integer | The next recurring product. Required when `next_recurring_product` is not provided. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples Update next recurring product by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29224,
"next_recurring_product": 6

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "d22895bf2943830a8be8988d0e076c3f",
        "b59d473387b5b4fc64a95da5f240510c",
        "6cce0566e9fdfd06a1e6ce43383ce20c"
    ],
    "update_type": "Next Recurring Product",
    "new_value": "6"
}

} “‘ Update next recurring product by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "b59d473387b5b4fc64a95da5f240510c",
"next_recurring_product": 5

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "b59d473387b5b4fc64a95da5f240510c"
    ],
    "update_type": "Next Recurring Product",
    "new_value": "5"
}

} “‘ Update next recurring product by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29224,
"product_id": 11,
"next_recurring_product": 5

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6cce0566e9fdfd06a1e6ce43383ce20c"
    ],
    "update_type": "Next Recurring Product",
    "new_value": "5"
}

} “‘ Update next recurring product by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29219,
"variant_id": 2,
"next_recurring_product": 5

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "62fbc8e17931e03963151316e9c5b4ee"
    ],
    "update_type": "Next Recurring Product",
    "new_value": "5"
}

} “‘ Update next recurring variant by order ID only. This will update all line items in the order: “` Request

"order_id": 29219,
"next_recurring_variant": 6

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "62fbc8e17931e03963151316e9c5b4ee",
        "640122fc14de0cb059572861346b8ab6"
    ],
    "update_type": "Next Recurring Variant",
    "new_value": "6"
}

} “‘ Update next recurring variant by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "62fbc8e17931e03963151316e9c5b4ee",
"next_recurring_variant": 2

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "62fbc8e17931e03963151316e9c5b4ee"
    ],
    "update_type": "Next Recurring Variant",
    "new_value": "2"
}

} “‘ Update next recurring variant by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29219,
"product_id": 12,
"next_recurring_variant": 6

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "62fbc8e17931e03963151316e9c5b4ee",
        "640122fc14de0cb059572861346b8ab6"
    ],
    "update_type": "Next Recurring Variant",
    "new_value": "6"
}

} “‘ Update next recurring variant by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29219,
"variant_id": 6,
"next_recurring_variant": 2

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "640122fc14de0cb059572861346b8ab6"
    ],
    "update_type": "Next Recurring Variant",
    "new_value": "2"
}

} “‘ type description here

Parameters:

  • body (UpdateNextRecurringProductRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 365

def update_next_recurring_product(body,
                                  domain,
                                  v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/next-recurring-product',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_next_recurring_quantity(body, domain, v2_ext) ⇒ ApiResponse

Update the next recurring quantity for one or more line items in a subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ———————– | ———– | ——- | ——— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | next_recurring_quantity | Required | - | Integer | The next recurring quantity. Must be greater than 0. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples Update next recurring quantity by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29242,
"next_recurring_quantity": 2

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "846c3fab798172978c11ea68684f83d4",
        "b6f2caf04da2f3dc89bbfc47bd4d076e"
    ],
    "update_type": "Next Recurring Quantity",
    "new_value": "2"
}

} “‘ Update next recurring quantity by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "b6f2caf04da2f3dc89bbfc47bd4d076e",
"next_recurring_quantity": 3

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "b6f2caf04da2f3dc89bbfc47bd4d076e"
    ],
    "update_type": "Next Recurring Quantity",
    "new_value": "3"
}

} “‘ Update next recurring quantity by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29242,
"product_id": 7,
"next_recurring_quantity": 4

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "b6f2caf04da2f3dc89bbfc47bd4d076e"
    ],
    "update_type": "Next Recurring Quantity",
    "new_value": "4"
}

} “‘ Update next recurring quantity by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29249,
"variant_id": 6,
"next_recurring_quantity": 3

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Next Recurring Quantity",
    "new_value": "3"
}

} “‘ type description here

Parameters:

  • body (UpdateNextRecurringQuantityRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 510

def update_next_recurring_quantity(body,
                                   domain,
                                   v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/next-recurring-quantity',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_recurring_billing_model(body, domain, v2_ext) ⇒ ApiResponse

Update the recurring billing model for one or more line items in a subscription. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ——— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | billing_model_id | Required | - | Integer | The new billing model ID. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples Update the recurring billing model by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29257,
"billing_model_id": 127

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "b50753ed2f30cdb3c98d25f1b0b29772",
        "a48ffbe6cb2f9609ab3bd1a41fdada4c"
    ],
    "update_type": "Billing Model",
    "new_value": "127"
}

} “‘ Update the recurring billing model by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "a48ffbe6cb2f9609ab3bd1a41fdada4c",
"billing_model_id": 102

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "a48ffbe6cb2f9609ab3bd1a41fdada4c"
    ],
    "update_type": "Billing Model",
    "new_value": "102"
}

} “‘ Update the recurring billing model by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29249,
"product_id": 12,
"billing_model_id": 102

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404",
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Billing Model",
    "new_value": "102"
}

} “‘ Update the recurring billing model by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29249,
"variant_id": 6,
"billing_model_id": 124

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Billing Model",
    "new_value": "124"
}

} “‘ type description here

Parameters:

  • body (UpdateRecurringBillingModelRequest)

    Required parameter: TODO:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 656

def update_recurring_billing_model(body,
                                   domain,
                                   v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/billing-model',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end

#update_recurring_price_preservation(body, domain, v2_ext) ⇒ ApiResponse

Update the next recurring price preservation for one or more line items in a subscription. If set to 0, then any custom next recurring prices will not take effect upon rebill. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description

|

| —————- | ———– | ——- | ———— | ————————————– | | order_id | Conditional | - | Integer | The (main) order ID associated with the subscription. Required unless ‘subscription_id` is provided. | | subscription_id | Conditional | - | String | The subscription ID that maps to a single item associated with an order. | | product_id | Conditional | - | Integer | The product ID that maps to one or more line items associated with an order. | | variant_id | Conditional | - | Integer | The variant ID that maps to one or more line items associated with an order. | | is_preserve | Required | - | Integer Flag | The next recurring price preservation flag. | **Response Data**\ Response parameters expected in each line item custom option object contained within the `data` field array: | Field | Data Type | Description

|

| ————————- | ——— | —————————————————————- | | affected_subscription_ids | Array | An array of affected subscription IDs associated with the order. | | update_type | String | Text describing the type of update that was performed. | | new_value | String | The updated value.

|

Examples Update the next recurring price preservation by order ID only. This will update all line items in the order: “‘ Request

"order_id": 29249,
"is_preserve": 1

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404",
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Recurring Price Preservation",
    "new_value": "1"
}

} “‘ Update the next recurring price preservation by subscription ID only. This will update the line item that matches the `subscription_id` parameter: “` Request

"subscription_id": "6eb4e8c959330f52c81982cf83474404",
"is_preserve": 0

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404"
    ],
    "update_type": "Recurring Price Preservation",
    "new_value": "0"
}

} “‘ Update the next recurring price preservation by Order ID + Product ID. This will the target line items that match the `product_id` parameter: “` Request

"order_id": 29249,
"product_id": 12,
"is_preserve": 1

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "6eb4e8c959330f52c81982cf83474404",
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Recurring Price Preservation",
    "new_value": "1"
}

} “‘ Update the next recurring price preservation by Order ID + Variant ID. This will update the target line items that match the `variant_id` parameter: “` Request

"order_id": 29249,
"variant_id": 6,
"is_preserve": 0

Response {

"status": "SUCCESS",
"data": {
    "affected_subscription_ids": [
        "225c0c4f0948f4ee7ba86b481580dd76"
    ],
    "update_type": "Recurring Price Preservation",
    "new_value": "0"
}

} “‘ TODO: type description here

Parameters:

  • body (UpdateRecurringPricePreservationRequest)

    Required parameter:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
# File 'lib/sticky_io_restful_api_v2025731/controllers/line_item_management_controller.rb', line 953

def update_recurring_price_preservation(body,
                                        domain,
                                        v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscription-orders/recurring-price-preservation',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .is_response_void(true)
                .is_api_response(true))
    .execute
end