# Place order with custom subscription settings

Use the **placeOrder** method to create an order using custom subscription settings via SOAP API 6.0.

## Request parameters

<table><thead><tr><th width="123.33349609375">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>sessionID</code></td><td><p><strong>Required (string)</strong></p><p>Session identifier, the output of the <strong>Login</strong> method. Include <code>sessionID</code> into all your requests. 2Checkout throws an exception if the values are incorrect. The <code>sessionI</code><strong>D</strong> expires in <strong>10 minutes</strong>.</p></td></tr><tr><td><a href="/pages/ntYqWA3pWPLrpvzTn87M"><code>Order</code></a></td><td><p><strong>Required (object)</strong></p><p>Object designed to collect all data necessary for an order, including billing, product / subscription plan, and payment details.</p></td></tr></tbody></table>

### Request sample

```php
<?php
$Order = new \stdClass();
$Order->Currency = 'usd';
$Order->Country = 'US';
$Order->Language = 'en';
$Order->CustomerIP = '91.220.121.21';
$Order->ExternalReference = NULL;
$Order->Source = NULL;
$Order->Affiliate = new stdClass();
$Order->Affiliate->AffiliateCode = 'Partner123'
$Order->Affiliate->AffiliateSource = 'MobilePlatform'
$Order->CustomerReference = NULL;

// Don't forget about B2B flag
$Order->ExtraInformation = new \stdClass();
$Order->ExtraInformation->B2B = true;

$Order->Items = array();
$Order->Items[0] = new \stdClass();
$Order->Items[0]->Code = 'my_subscription_1';
$Order->Items[0]->Quantity = 1;
$Order->Items[0]->PriceOptions = NULL;
$Order->Items[0]->SKU = NULL;
$Order->Items[0]->Price = NULL;
$Order->Items[0]->CrossSell = NULL;
$Order->Items[0]->Trial = false;
$Order->Items[0]->AdditionalFields = NULL;
$Order->Items[0]->SubscriptionStartDate = NULL; //If empty or null, subscriptions become active when purchase is made.

// Subscription custom settings
$Order->Items[0]->SubscriptionCustomSettings = new \stdClass();
$Order->Items[0]->SubscriptionCustomSettings->ContractLength = "123";
$Order->Items[0]->SubscriptionCustomSettings->CycleAmountType = "NET";
$Order->Items[0]->SubscriptionCustomSettings->CycleUnit = "DAY";
$Order->Items[0]->SubscriptionCustomSettings->CycleAmount = "123";
$Order->Items[0]->SubscriptionCustomSettings->CycleLength = "123";
$Order->Items[0]->SubscriptionCustomSettings->MerchantDealAutoRenewal = true;
$Order->Items[0]->SubscriptionCustomSettings->ClientDealAutoRenewal = true;

$Order->BillingDetails = new \stdClass();
$Order->BillingDetails->FirstName = 'First';
$Order->BillingDetails->LastName = 'Last';
$Order->BillingDetails->CountryCode = 'us';
$Order->BillingDetails->State = 'California';
$Order->BillingDetails->City = 'LA';
$Order->BillingDetails->Address1 = 'Address example';
$Order->BillingDetails->Address2 = NULL;
$Order->BillingDetails->Zip = '90210';
$Order->BillingDetails->Email = 'email@address.com';
$Order->BillingDetails->Phone = NULL;
$Order->BillingDetails->Company = NULL;
$Order->DeliveryDetails = NULL;

$Order->PaymentDetails = new \stdClass ();
$Order->PaymentDetails->Type = 'CC';
$Order->PaymentDetails->Currency = 'usd';
$Order->PaymentDetails->PaymentMethod = new \stdClass ();
$Order->PaymentDetails->CustomerIP = '10.10.10.10';
$Order->PaymentDetails->PaymentMethod->RecurringEnabled = true;
$Order->PaymentDetails->PaymentMethod->CardNumber = "4111111111111111";
$Order->PaymentDetails->PaymentMethod->CardType = 'visa';
$Order->PaymentDetails->PaymentMethod->ExpirationYear = '2019';
$Order->PaymentDetails->PaymentMethod->ExpirationMonth = '12';
$Order->PaymentDetails->PaymentMethod->CCID = '123';
$Order->PaymentDetails->PaymentMethod->HolderName = 'John';
$Order->PaymentDetails->PaymentMethod->CardNumberTime = 83.21; // can be null - high value in seconds is a red flag for fraud attempts.
$Order->PaymentDetails->PaymentMethod->HolderNameTime = 13.35; // can be null - high value in seconds is a red flag for fraud attempts.
$Order->PaymentDetails->PaymentMethod->Vendor3DSReturnURL = "http://www.success.ro";
$Order->PaymentDetails->PaymentMethod->Vendor3DSCancelURL = "http://www.error.ro";

try {
    $newOrder = $client->placeOrder($sessionID, $Order);
} catch (SoapFault $e) {
    echo "newOrder: " . $e->getMessage();
    exit;
}
```

## Response parameters

<table><thead><tr><th width="186.2666015625">Parameters</th><th>Type / Description</th></tr></thead><tbody><tr><td><a href="/pages/010708cd78f3efa4929d4374cb2abe08c3d2b686"><code>Order information</code></a></td><td><p><strong>Object</strong></p><p>Object that includes all data necessary for an order, including billing, product/subscription plan, and payment details.</p></td></tr></tbody></table>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.2checkout.com/soap-api-reference/soap-api-6.0/api-requests/place-orders-with-catalog-products/place-order-with-custom-subscription-settings.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
