Class: BeyondApi::OrderSettings
- Includes:
- Utils
- Defined in:
- lib/beyond_api/resources/order_settings.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#all ⇒ OpenStruct
A
GET
request is used to retrieve the order settings. -
#update(body) ⇒ OpenStruct
A
PUT
request is used to update the order settings.
Methods included from Utils
#file_content_type, #handle_all_request, #handle_error, #handle_response, #sanitize_key, #sanitize_response, #to_object_struct
Methods inherited from Base
Constructor Details
This class inherits a constructor from BeyondApi::Base
Instance Method Details
#all ⇒ OpenStruct
A GET
request is used to retrieve the order settings.
$ curl 'https://api-shop.beyondshop.cloud/api/order-settings' -i -X GET \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>'
23 24 25 26 27 |
# File 'lib/beyond_api/resources/order_settings.rb', line 23 def all response, status = BeyondApi::Request.get(@session, "/order-settings") handle_response(response, status) end |
#update(body) ⇒ OpenStruct
A PUT
request is used to update the order settings.
$ curl 'https://api-shop.beyondshop.cloud/api/order-settings' -i -X PUT \
-H 'Content-Type: application/json' \
-H 'Accept: application/hal+json' \
-H 'Authorization: Bearer <Access token>' \
-d '{
"invoiceCancelationNote" : "This is an invoice cancelation note",
"defaultDeliveryDateNote" : "This is the default delivery date note",
"defaultInvoiceNote" : "This is the default invoice note",
"orderNumberConfiguration" : {
"stringPrefix" : "2017-shop-",
"nextNumericSuffix" : 1000,
"numericSuffixLength" : 4
},
"invoiceNumberConfiguration" : {
"stringPrefix" : "2017-invoice-",
"nextNumericSuffix" : 1000,
"numericSuffixLength" : 4
},
"customOrderOpenMailText" : " Your <br /> 1",
"customOrderCanceledMailText" : " Your <br /> 2",
"customInvoiceCustomerMailText" : " Your <br /> 3",
"customInvoiceCanceledMailText" : " Your <br /> 4",
"customOrderShippedMailText" : " Your <br /> 5",
"customOrderPendingMailText" : " Your <br /> 6",
"customOrderReturnedMailText" : " Your <br /> 7"
}'
91 92 93 94 95 |
# File 'lib/beyond_api/resources/order_settings.rb', line 91 def update(body) response, status = BeyondApi::Request.put(@session, "/order-settings", body) handle_response(response, status) end |