Firmas - TAIS2020/Laurel GitHub Wiki

create-review

Petición

POST /item/<id_item>/reviews

{
	"item_id": 1,
	"score": 5,
	"comment": "Free text upt to 120 characters"
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

create-answer

Petición

POST /item/<id_item>/questions/<id_question>/answer

{
	"message": "Up to 120 characters",
	"user_id": 461549
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

create-item & update-item

Petición

POST /item PUT /item/<id_item>

{
	"name": "Item name up to 50 characters",
	"description" : "description up to 1000 characters",
	"price": 100.00,
	"in_stock": 50,
	"photos": [
		{
			"url": "https://image-host/idphoto1"
		},
		{
			"url": "https://image-host/idphoto2"
		}
	]
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

delete-item

Petición

DELETE /item/<id_item>

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

get-item

Petición

GET /item/<id_item>

Respuesta

Status code: 200 / 404 / 500

{
	"item_id": 451239,
	"name": "Item name up to 50 characters",
	"description" : "description up to 1000 characters",
	"price": 100.00,
	"in_stock": 50,
	"photos": [
		{
			"url": "https://image-host/idphoto1"
		},
		{
			"url": "https://image-host/idphoto2"
		}
	]
}

get-items

Petición

GET /items?q=search%20terms

Respuesta

Status code: 200 / 404 / 500

{
	"items": [
		{
			"item_id": 451239,
			"name": "Item name up to 50 characters",
			"description" : "description up to 1000 characters",
			"price": 100.00,
			"in_stock": 50,
			"photos": [
				{
					"url": "https://image-host/idphoto1"
				},
				{
					"url": "https://image-host/idphoto2"
				}
			]
		},
		{
			"item_id": 451240,
			"name": "Item name up to 50 characters",
			"description" : "description up to 1000 characters",
			"price": 100.00,
			"in_stock": 50,
			"photos": [
				{
					"url": "https://image-host/idphoto3"
				},
				{
					"url": "https://image-host/idphoto4"
				}
			]
		}
	]
}

add-item-cart

Petición

PUT /users/<id_user>/cart

{
	"item": 456741,
	"quantity": 5
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

delete-item-cart

Petición

DELETE /users/<id_user>/cart/item/<id_item>

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

get-cart

Petición

GET /users/<id_user>/cart

Respuesta

Status code: 200 / 404 / 500

{
	"items": [
		{
			"item_id": 46776,
			"quantity": 2,
			"unit_price": 5000
		},
		{
			"item_id": 46777,
			"quantity": 1,
			"unit_price": 200
		},
	]
}

payment

Petición

POST /payments

{
	"user_id": 7861241,
	"payment_method": "cc",
	"quotas": 12,
	"address_number": "calle 80 No. 65 - 75"
}

Respuesta

Status code: 200 / 500

payment-gateway

Petición

POST /mock-payment-service?callback=https:///payments/landing/<id_user>

{
	"card_number": 4654654564,
	"card_holder": "jane doe",
	"card_expiration_date": "08/23",
	"cvv": 999
}

Respuesta

Status code: 301 / 500

payment-landing

Petición

POST /payments/landing/<id_user>

{
	"transaction_id": 635473,
	"result": "ok"
}

Respuesta

Status code: 200 / 500

users

Petición

GET /users/<id_user>

Respuesta

Status code: 200 / 404 / 500

{
	"user_id": 654132,
	"name": "jane",
	"last_name": "doe",
	"document_type": "cc",
	"document_number": "12345",
	"email": "[email protected]",
	"phone": "573015574489"
}

get-address-price

Petición

GET /shipping/price?from_lat=999&from_long=999&to_lat=888&to_long=888

Respuesta

Status code: 200 / 404 / 500

25

create-shipping

Petición

POST /shipping

{
	"paymentId": 48732,
	"items": [
		{
			"id": 1,
			"quantity": 2
		},
		{
			"id": 2,
			"quantity": 1
		}
	],
	"address": "address line"
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

create-shipping-request

Petición

POST /users/<id_user>/shipping-request

{
	"shipping_id": 23423,
	"payment_id": 46782
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}

shipping-confirmation

Petición

PUT /shippings/<id_shipping>/confirm

{
    "carrier": "Deprisa",
    "sendingTimestamp": "2020-11-12 16:30:05",
    "trackingCode": "abc-123",
    "expectedDeliveryDate": "2020-11-13"
}

Respuesta

Status code: 200 / 404 / 500

{
    "id": 2,
    "paymentId": 2167,
    "address": "some address",
    "carrier": "Deprisa",
    "trackingCode": "abc-123",
    "sendingTimestamp": "2020-11-12T16:30:05",
    "expectedDeliveryDate": "2020-11-13",
    "items": [
        {
            "id": 1,
            "quantity": 2
        },
        {
            "id": 2,
            "quantity": 20
        }
    ]
}

create-notification

Petición

POST /notification

{
	"idUser": 1,
	"message": "Se envia la notificacion al usuario",
}

Respuesta

Status code: 200 / 404 / 500

{
	"message": "ok"
}
⚠️ **GitHub.com Fallback** ⚠️