The Create Offer operation creates an offer with the offer object provided in the body of the post.

Request

The Create Offer request may be specified as follows.

Method Request URI HTTP Version

POST

https://admin-management.contoso.net/offers

HTTP/1.1

URI Parameters

None.

Request Headers

The following table describes request headers.

Request Header Description

Content-Type

Set this header to application/xml; charset=utf-8.

Authorization

Specifies the credentials for this request. The value of this header must be set Negotiate <token>.

Request Body

The format for the request body is as follows:

Copy Code
<Offer xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/windowsazure">
  <Name>0CFSRBHFD2GOC3MXGKIL9V4HAIQ512LQKGNYMVCU20GAOTQEPW0SI11OI9SIUMOL</Name>
  <DisplayName>45CU8SH4UX93PF7A8YZHHLCBC2V7S4725JFGY6UUZ4LY35KN6VR2M97R2ASF7KL1</DisplayName>
  <TenantDisplayName>QD6QQXLM36X7RHP5GA6E19GDFK55KD6V291NWB8E8L7N1RETW0EJ2U9S73KG4RBZ</TenantDisplayName>
  <InvitationCode>2H8G0ZLBDESNANJIQHB8MFP7MYOXNPXPSU7V7EOGJPXHQSRO2JYZIOOW2B4LKXYY</InvitationCode>
  <SubscriptionCount>3317</SubscriptionCount>
  <ServiceOffers>
	<ServiceOffer>
	<ServiceName>T2VPPBGD</ServiceName>
	<ServiceOfferSettings />
	<ServiceDisplayName>DisplayName:T2VPPBGD</ServiceDisplayName>
	</ServiceOffer>
  </ServiceOffers>
</Offer>

Important
The order of the elements in the request body is significant. If an element is required, it must appear in the XML in the order shown above.

The following table describes the key elements of the request body:

Element Name

Description

Name

A name for the offer that is unique. Must use numbers and letters only.

DisplayName

The name can be used identify the offer for your tracking purposes.

TenantDisplayName

A name for the tenant-side display name

InvitationCode

Specifies the invitation code for the offer

ServiceOffers

Specifies the service-side offers, if applicable, associated with this offer. Includes the service name, service display name, and service offer settings

Response

The response includes an HTTP status code, a set of response headers, and a response body.

Status Code

The status code is embedded in the response for this operation; if successful, it will be status code 200 (OK).

Response Headers

The response for this operation includes the following headers. The response may also include additional standard HTTP headers. All standard headers conform to the HTTP/1.1 protocol specification.

Response Header Description

None

None

Response Body

None.

Example

Create an offer.

Copy Code
public void CreateOffer(string adminServiceEndpoint)
{
	HttpClient httpClient = new HttpClient();
	httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("BASIC", Convert.ToBase64String(UnicodeEncoding.Unicode.GetBytes("AdminPortal:" + password)))));

	string subscriptionEndpoint = adminServiceEndpoint + "offers/";
	var offerInfo = new Offer()
	{
		Name = "ProgCreate0234",
		DisplayName = "ProgramCreate",
		ServiceOffers = {
			new ServiceOffer()
				{
					OfferName = "ProgramCreateSql",
					ServiceName = "sqlservers"
			},
			new ServiceOffer()
				{
					OfferName = "ProgramCreateMySql",
					ServiceName = "mysqlservers"
			}
	},
};
	httpClient.PostAsXmlAsync<Offer>(subscriptionEndpoint, offerInfo).Result.EnsureSuccessStatusCode();
}