Skip to content

Latest commit

 

History

History
260 lines (235 loc) · 4.42 KB

Api.Order.md

File metadata and controls

260 lines (235 loc) · 4.42 KB

Clean Commerce Api

Table of contents

Order

Create

POST {{host}}/order/create

Create request

{
	"userId" :  "00000000-0000-0000-0000-000000000000",
	"orderItems" : [
		{
			"productId" :  "00000000-0000-0000-0000-000000000000",
			"amount" : 1
		},
		{
			"productId" :  "11111111-1111-1111-1111-111111111111",
			"amount" : 2
		}],
	"totalPrice" : 100.00,
	"shippingAddress" : {
		"street" : "123 Main St.",
		"city" : "New York",
		"state" : "NY",
		"zip" : "10001"
	},
	"payment" : {
		"cardNumber" : "0000000000000000",
		"expirationDate" : "2016-01-01T00:00:00.0000000Z",
		"securityCode" : "000",
		"currency" : "EUR",
		"billingAddress" : {
			"street" : "123 Main St.",
			"city" : "New York",
			"state" : "NY",
			"zip" : "10001"
		}
	}
}

Create response

201 Created
{
	"id" :  "00000000-0000-0000-0000-000000000000",
	"userId" :  "00000000-0000-0000-0000-000000000000",
	"orderItems" : [
		{
			"productId" :  "00000000-0000-0000-0000-000000000000",
			"amount" : 1
		},
		{
			"productId" :  "11111111-1111-1111-1111-111111111111",
			"amount" : 2
		}],
	"totalPrice" : 100.00,
	"shippingAddress" : {
		"street" : "123 Main St.",
		"city" : "New York",
		"state" : "NY",
		"zip" : "10001"
	},
	"created" : "2016-01-01T00:00:00.0000000Z",
	"updated" : "2016-01-01T00:00:00.0000000Z",
	"status" : "working"
	"payment" : {
		"cardNumber" : "0000000000000000",
		"expirationDate" : "2016-01-01T00:00:00.0000000Z",
		"securityCode" : "000",
		"currency" : "EUR",
		"billingAddress" : {
			"street" : "123 Main St.",
			"city" : "New York",
			"state" : "NY",
			"zip" : "10001"
		}
	}
}

Get

GET {{host}}/order/{{id}}

Get request

{
}

Get response

200 OK
{
	"id" :  "00000000-0000-0000-0000-000000000000",
	"userId" :  "00000000-0000-0000-0000-000000000000",
	"orderItems" : [
		{
			"productId" :  "00000000-0000-0000-0000-000000000000",
			"amount" : 1
		},
		{
			"productId" :  "11111111-1111-1111-1111-111111111111",
			"amount" : 2
		}],
	"totalPrice" : 100.00,
	"shippingAddress" : {
		"street" : "123 Main St.",
		"city" : "New York",
		"state" : "NY",
		"zip" : "10001"
	},
	"created" : "2016-01-01T00:00:00.0000000Z",
	"updated" : "2016-01-01T00:00:00.0000000Z",
	"status" : "working"
	"payment" : {
		"cardNumber" : "0000000000000000",
		"expirationDate" : "2016-01-01T00:00:00.0000000Z",
		"securityCode" : "000",
		"currency" : "EUR",
		"billingAddress" : {
			"street" : "123 Main St.",
			"city" : "New York",
			"state" : "NY",
			"zip" : "10001"
		}
	}
}

Update

PUT {{host}}/order/{{id}}

Update request

{
	"userId" :  "00000000-0000-0000-0000-000000000000",
	"orderItems" : [
		{
			"productId" :  "00000000-0000-0000-0000-000000000000",
			"amount" : 1
		},
		{
			"productId" :  "11111111-1111-1111-1111-111111111111",
			"amount" : 2
		}],
	"totalPrice" : 100.00,
	"shippingAddress" : {
		"street" : "123 Main St.",
		"city" : "New York",
		"state" : "NY",
		"zip" : "10001"
	},
	"status" : "working"
	"payment" : {
		"cardNumber" : "0000000000000000",
		"expirationDate" : "2016-01-01T00:00:00.0000000Z",
		"securityCode" : "000",
		"currency" : "EUR",
		"billingAddress" : {
			"street" : "123 Main St.",
			"city" : "New York",
			"state" : "NY",
			"zip" : "10001"
		}
	}
}

Update response

200 OK
{
	"id" :  "00000000-0000-0000-0000-000000000000",
	"userId" :  "00000000-0000-0000-0000-000000000000",
	"orderItems" : [
		{
			"productId" :  "00000000-0000-0000-0000-000000000000",
			"amount" : 1
		},
		{
			"productId" :  "11111111-1111-1111-1111-111111111111",
			"amount" : 2
		}],
	"totalPrice" : 100.00,
	"shippingAddress" : {
		"street" : "123 Main St.",
		"city" : "New York",
		"state" : "NY",
		"zip" : "10001"
	},
	"created" : "2016-01-01T00:00:00.0000000Z",
	"updated" : "2016-01-01T00:00:00.0000000Z",
	"status" : "working",
	"payment" : {
		"cardNumber" : "0000000000000000",
		"expirationDate" : "2016-01-01T00:00:00.0000000Z",
		"securityCode" : "000",
		"currency" : "EUR",
		"billingAddress" : {
			"street" : "123 Main St.",
			"city" : "New York",
			"state" : "NY",
			"zip" : "10001"
		}
	}
}

Delete

DELETE {{host}}/order/{{id}}

Delete request

{
}

Delete response

200 OK
{
}