Language

2Checkout Documentation

Create

The OptionService class provides methods to create, retrieve, update and delete options.

Method

Create

Use to create an option.

Arguments

  • TwoCheckoutConfig - Set your ApiUsername and ApiPassword.
  • OptionCreateServiceOptions - Object composed of create option attributes.

Returns

Returns a TwocheckoutResponse object.

Example Usage:

var ServiceObject = new OptionService();
var ArgsObject = new OptionCreateServiceOptions();
ArgsObject.option_name = "Test Option";
ArgsObject.option_value_name = "Test Opiton Value";
ArgsObject.option_value_surcharge = (decimal)2.00;

var result = ServiceObject.Create(ArgsObject);

Example Response:

{TwoCheckout.TwoCheckoutResponse}
  response_code: "OK"
  response_message: "Option created successfully"
  option_id: "4831124727"