Esse documento explica com exemplos de uso de nossa API REST a criação e finalização de carrinho de compras.
Nota |
---|
Requisições POST devem ter o header “Content-Type“ com o valor “application/vnd.api+json“ para evitar erros na criação de itens |
Pré-checagem
Pegar informações de um endereço pelo CEP
Checagem inicial de cobertura na cidade do cliente
Checagem financeira
KMZ
Pegar coordenadas de um endereço
Pegar endereço pelas coordenadas
Verificar cobertura de um endereço
Checkout
Pegar ID do Revendedor
Salvar endereço do cliente
Criação de carrinho
Pegar contratos disponíveis
Pegar os planos disponíveis
Adição de produto no carrinho
Pegar os adicionais de um produto
Remoção de um produto do carrinho
Pegar carrinho
Aplicar cupom
Remover cupom
Pegar dados do "Como você chegou até nós?"
Pegar bancos
Pegar datas de vencimento de uma cidade
Pegar termos de um carrinho
Pegar documentos necessários
Atualizar o carrinho
Conversão em pedido
...
...
Pré-checagem:
Pegar informações de um endereço pelo CEP:
...
Endpoint: GET /api/address/{CEP}/postal_code/
Parâmetros:
CEP | CEP que deseja buscar as informações | String |
---|
Exemplo de resposta:
Bloco de código | ||
---|---|---|
| ||
{ "data": { "type": "Address", "id": null, "attributes": { "nickname": "", "first_name": "", "last_name": "", "company_name": "", "number": "", "street_address_1": "Avenida José Antônio Lorenzetti", "street_address_2": "", "street_address_3": "Jardim São João", "city": "Lençóis Paulista", "state": "SP", "postal_code": "18680-410", "country": null, "country_area": "", "phone": "", "is_default": false, "type": null, "latitude": "", "longitude": "" } } } |
...
Endpoint: GET /api/provider/city/{CEP}/postal_code/
Parâmetros:
CEP | CEP que deseja verificar | String |
---|
Exemplo de resposta:
Caso exista cobertura, retornará as informações do CEP, com o status 200:
...
Endpoint: POST /api/store/cart/pre_check/
Atributos:
taxvat | CPF | String |
---|---|---|
token | Token do carrinho | String |
stop_invalid_taxvat | Parar se o CPF for invalido | Boolean |
Exemplo:
Body:
Bloco de código |
---|
{ "taxvat": "452.099.670-85", "token": "5b2a6a6c-8797-466e-b430-2100cad7fbd9", "stop_invalid_taxvat": true } |
...
Endpoint: POST /api/provider/coverage/geocode/
Atributos:
street_address_1 | Rua | String |
---|---|---|
street_address_3 | Bairro | String |
address_number | Número | String |
postal_code | CEP | String |
state | Estado (sigla) | String |
city | Cidade | String |
Exemplo:
Body:
Bloco de código | ||
---|---|---|
| ||
{ "data": { "type": "Coverage", "attributes": { "street_address_1": "Avenida José Antônio Lorenzetti", "street_address_3": "Jardim São João", "address_number": "0", "postal_code": "18680-410", "state": "SP", "city": "Lençóis Paulista" } } } |
Resposta:
Bloco de código |
---|
{ "data": { "street_address_1": "Avenida José Antônio Lorenzetti", "street_address_3": "Jardim São João", "address_number": "0", "postal_code": "18680-410", "state": "SP", "city": "Lençóis Paulista", "latitude": -22.5879666, "longitude": -48.7980126 } } |
...
Endpoint: POST /api/provider/coverage/address/
Atributos:
latitude | Number | |
---|---|---|
longitude | Number |
Exemplo:
Body:
Bloco de código |
---|
{ "data": { "type": "Coverage", "attributes": { "latitude": -22.5879666, "longitude": -48.7980126 } } } |
Resposta:
Bloco de código | ||
---|---|---|
| ||
{ "data": { "address": "R. Nicolau Dias Batista", "number": "1", "neighborhood": "Parque Res. Elizabeth", "city": "Lençóis Paulista", "state": "SP", "country": "BR", "postal_code": "18680-440" } } |
...
Endpoint: POST /api/provider/coverage/check_coverage/
Atributos:
street_address_1 | Rua | String |
---|---|---|
street_address_3 | Bairro | String |
address_number | Número | String |
postal_code | CEP | String |
state | Estado (sigla) | String |
city | Cidade | String |
latitude | Latitude | Number |
longitude | Longitude | Number |
Exemplo:
Body:
Bloco de código |
---|
{ "data": { "type": "Coverage", "attributes": { "street_address_1": "Rua Paraná", "street_address_3": "Jardim Cruzeiro", "address_number": "222", "postal_code": "18680-510", "state": "SP", "city": "Lençóis Paulista", "latitude": -22.5885833, "longitude": -48.7980126 } } } |
Caso tenha cobertura retornara o status 200:
...
Endpoint: POST /api/address/
Atributos:
first_name | Nome | String |
---|---|---|
last_name | Sobrenome | String |
city | Cidade | String |
number | Número | String |
street_address_1 | Rua | String |
street_address_2 | Complemento | String |
street_address_3 | Bairro | String |
state | Estado (sigla) | String |
postal_code | CEP | String |
country | Pais (sigla) | String |
country_area | Pais (sigla) | String |
Exemplo:
Body:
Bloco de código |
---|
{ "data": { "type": "Address", "attributes": { "first_name": "Nome", "last_name": "Sobrenome", "city": "Lençóis Paulista", "number": "999", "street_address_1": "Rua São Pedro", "street_address_2": "", "street_address_3": "Centro", "state": "SP", "postal_code": "18680-049", "country": "BR", "country_area": "BR" } } } |
Resposta:
Bloco de código |
---|
{ "data": { "type": "Address", "id": "723", "attributes": { "created": "2022-02-24T14:55:28.492506-03:00", "updated": "2022-02-24T14:55:28.492572-03:00", "nickname": "", "first_name": "Nome", "last_name": "Sobrenome", "company_name": null, "number": "999", "street_address_1": "Rua São Pedro", "street_address_2": "", "street_address_3": "Centro", "city": "Lençóis Paulista", "state": "SP", "postal_code": "18680-049", "country": "BR", "country_area": "BR", "phone": "", "is_default": null, "type": "billing", "latitude": "", "longitude": "" }, "relationships": { "user": { "links": { "self": "http://devisp.datacake.com.br/api/address/723/relationships/user/", "related": "http://devisp.datacake.com.br/api/address/723/user/" }, "data": null } } } } |
...
Endpoint: POST /api/store/cart/?include=billing_address,shipping_address
Atributos:
extra_data | JSON | |
---|---|---|
String |
Atributos do “extra_data”:
resseller_id | ID do Revendedor | String |
---|---|---|
mobile | Número de telefone | String |
paymentType | Tipo de pagamento | String |
current_step | Etapa atual do checkout | String |
current_wizard_step | Subetapa atual do checkout | String |
condo | Condominio | String |
condo_number | Número do condominio | String |
plan_type_id | ID do tipo de plano | String |
customer_type | Tipo de usuario (novo ou velho) | String |
city_id | ID da cidade | String |
is_migration | É migração | Boolean |
city_has_radio | Cidade tem radio | Boolean |
city_has_fiber | Cidade tem fibra | Boolean |
city_has_phone | Cidade tem telefone | Boolean |
city_has_tv | Cidade tem tv | Boolean |
cpf | CPF | String |
migration_type | Tipo de migração (apenas se for migração) | String |
has_hidden_product | Existe produto oculto | Boolean |
Atributos do “relationships”:
billing_address | ID do endereço do cliente criado anteriormente |
---|---|
shipping_address | ID do endereço do cliente criado anteriormente |
Exemplo de uso:
Body:
Bloco de código | ||
---|---|---|
| ||
{ "data": { "relationships": { "billing_address": { "data": { "type": "Address", "id": "675" } }, "shipping_address": { "data": { "type": "Address", "id": "675" } } }, "type": "Cart", "attributes": { "extra_data": { "reseller_id": "53", "mobile": "(14) 98198-3853", "paymentType": "email", "current_step": "0", "current_wizard_step": "1", "condo": "", "condo_number": "", "plan_type_id": "1", "customer_type": "new", "city_id": "11", "is_migration": false, "city_has_radio": false, "city_has_fiber": false, "city_has_phone": false, "city_has_tv": false, "cpf": "993.464.350-20", "migration_type": null, "has_hidden_product": false }, "email": "Emailteste@gmail.com" } } } |
...
Endpoint: GET /api/store/product/?page[number]={page_number}&page[size]={page_size}&include=product_type&city__id={city__id}&restricted_customers={restricted_customers}
Parâmetros:
page |
---|
[size] | Quantidades de itens por página | Number |
---|---|---|
page |
[number] | Qual página deseja pegas as informações | Number |
---|---|---|
city__id | ID da cidade que desaja pegar os planos | Number |
restricted_customers | TRUE se o usuario tiver restrição | Boolean |
Exemplo:
Resposta:
Bloco de código |
---|
{ "links": { "first": "http://devisp.datacake.com.br/api/store/product/?city__id=11&fields=product_type%2Cid%2Cname%2Csku%2Cdescription%2Cpricing_list%2Cvisibility%2Cpricing_sale%2Cproduct_class%2Cdata%2Cpositon%2Cpricing_sorting%2Cchannel_count%2Cchannel_hd_count&include=product_type&page%5Bnumber%5D=1", "last": "http://devisp.datacake.com.br/api/store/product/?city__id=11&fields=product_type%2Cid%2Cname%2Csku%2Cdescription%2Cpricing_list%2Cvisibility%2Cpricing_sale%2Cproduct_class%2Cdata%2Cpositon%2Cpricing_sorting%2Cchannel_count%2Cchannel_hd_count&include=product_type&page%5Bnumber%5D=1", "next": null, "prev": null }, "data": [ { "type": "Product", "id": "51", "attributes": { "pricing_sorting": "9.99", "pricing_list": "9.99", "data": { "thumbnail": null, "max_on_cart": "1", "checkout_icon": null, "multiple_on_cart": false, "free_extra_tv_decoder": null, "paid_extra_tv_decoder": null }, "pricing_sale": null, "sku": "in-opc-001", "name": "Opcional de teste", "description": "Opcional de teste", "visibility": "all", "product_class": "addon", "channel_count": 0, "channel_hd_count": 0 }, "relationships": { "product_type": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/51/relationships/product_type/", "related": "http://devisp.datacake.com.br/api/store/product/51/product_type/" }, "data": { "type": "ProductType", "id": "1" } } } }, { "type": "Product", "id": "50", "attributes": { "pricing_sorting": "49.99", "pricing_list": "49.99", "data": { "ribbon": null, "upload": "20", "download": "100", "sub_title": null, "thumbnail": null, "upload_icon": null, "addon_icon_1": null, "addon_icon_2": null, "addon_icon_3": null, "addon_icon_4": null, "addon_text_1": null, "addon_text_2": null, "addon_text_3": null, "addon_text_4": null, "checkout_icon": null, "display_title": "Internet", "download_icon": null, "franquia_dado": null, "is_best_seller": null, "addon_icon_cart_1": null, "addon_icon_cart_2": null, "addon_icon_cart_3": null, "addon_icon_cart_4": null, "addon_text_cart_1": null, "addon_text_cart_2": null, "addon_text_cart_3": null, "addon_text_cart_4": null, "short_description": null }, "pricing_sale": null, "sku": "int-normal-lp", "name": "Internet Normalzinha", "description": "Internet normal", "visibility": "all", "product_class": "simple", "channel_count": 0, "channel_hd_count": 0 }, "relationships": { "product_type": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/product_type/", "related": "http://devisp.datacake.com.br/api/store/product/50/product_type/" }, "data": { "type": "ProductType", "id": "4" } } } }, { "type": "Product", "id": "42", "attributes": { "pricing_sorting": "99.90", "pricing_list": "99.90", "data": { "display_title": "<span class=\"prefix\">CONNECT</span><span class=\"title\">TV TOTAL</span>", "free_extra_tv_decoder": null, "paid_extra_tv_decoder": null }, "pricing_sale": null, "sku": "hdtv-a", "name": "HDTV TURBO", "description": "", "visibility": "all", "product_class": "simple", "channel_count": 0, "channel_hd_count": 0 }, "relationships": { "product_type": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/42/relationships/product_type/", "related": "http://devisp.datacake.com.br/api/store/product/42/product_type/" }, "data": { "type": "ProductType", "id": "2" } } } } ], "included": [ { "type": "ProductType", "id": "1", "attributes": { "weight": "0.0 kg", "created": "2021-01-12T00:20:22.905445-02:00", "updated": "2021-01-12T00:20:22.905479-02:00", "product_class": "addon", "name": "Opcionais", "code": "opcionais", "has_variants": true, "is_shipping_required": false }, "relationships": { "data": { "meta": { "count": 6 }, "data": [ { "type": "ProductAttribute", "id": "33" }, { "type": "ProductAttribute", "id": "32" }, { "type": "ProductAttribute", "id": "30" }, { "type": "ProductAttribute", "id": "29" }, { "type": "ProductAttribute", "id": "16" }, { "type": "ProductAttribute", "id": "15" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/product-type/1/relationships/data/", "related": "http://devisp.datacake.com.br/api/store/product-type/1/data/" } } } }, { "type": "ProductType", "id": "2", "attributes": { "weight": "0.0 kg", "created": "2021-01-12T00:20:43.367249-02:00", "updated": "2022-01-26T12:28:33.034977-02:00", "product_class": "simple", "name": "TV", "code": "tv", "has_variants": true, "is_shipping_required": false }, "relationships": { "data": { "meta": { "count": 3 }, "data": [ { "type": "ProductAttribute", "id": "30" }, { "type": "ProductAttribute", "id": "29" }, { "type": "ProductAttribute", "id": "4" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/product-type/2/relationships/data/", "related": "http://devisp.datacake.com.br/api/store/product-type/2/data/" } } } }, { "type": "ProductType", "id": "4", "attributes": { "weight": "0.0 kg", "created": "2021-01-12T00:22:00.990090-02:00", "updated": "2021-02-03T17:47:44.254117-02:00", "product_class": "simple", "name": "Internet Fibra", "code": "fiber", "has_variants": true, "is_shipping_required": false }, "relationships": { "data": { "meta": { "count": 28 }, "data": [ { "type": "ProductAttribute", "id": "41" }, { "type": "ProductAttribute", "id": "40" }, { "type": "ProductAttribute", "id": "39" }, { "type": "ProductAttribute", "id": "38" }, { "type": "ProductAttribute", "id": "37" }, { "type": "ProductAttribute", "id": "36" }, { "type": "ProductAttribute", "id": "35" }, { "type": "ProductAttribute", "id": "34" }, { "type": "ProductAttribute", "id": "31" }, { "type": "ProductAttribute", "id": "28" }, { "type": "ProductAttribute", "id": "27" }, { "type": "ProductAttribute", "id": "17" }, { "type": "ProductAttribute", "id": "16" }, { "type": "ProductAttribute", "id": "15" }, { "type": "ProductAttribute", "id": "14" }, { "type": "ProductAttribute", "id": "13" }, { "type": "ProductAttribute", "id": "12" }, { "type": "ProductAttribute", "id": "11" }, { "type": "ProductAttribute", "id": "10" }, { "type": "ProductAttribute", "id": "9" }, { "type": "ProductAttribute", "id": "8" }, { "type": "ProductAttribute", "id": "7" }, { "type": "ProductAttribute", "id": "6" }, { "type": "ProductAttribute", "id": "5" }, { "type": "ProductAttribute", "id": "4" }, { "type": "ProductAttribute", "id": "3" }, { "type": "ProductAttribute", "id": "2" }, { "type": "ProductAttribute", "id": "1" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/product-type/4/relationships/data/", "related": "http://devisp.datacake.com.br/api/store/product-type/4/data/" } } } } ], "meta": { "pagination": { "page": 1, "pages": 1, "count": 3 } } } |
...
Endpoint: POST /api/store/cart-item/?include=product%2Ccart%2Ccart.items%2Ccart.items.product
Atributos:
quantity | Quantidade do produto | Number |
---|
Headers:
x-cart-token | Token do carrinho | String |
---|
Atributos do “relationships“:
product | ID do produto que deseja colocar no carrinho |
---|---|
cart | ID do carrinho |
Exemplo de uso:
Body:
Bloco de código |
---|
{ "data": { "relationships": { "product": { "data": { "type": "Product", "id": "50" } }, "cart": { "data": { "type": "Cart", "id": "1054" } } }, "type": "CartItem", "attributes": { "quantity": 1 } } } |
...
Endpoint: GET /api/store/product/{product_id}/addons/?include=product_type%2Ccategories
Parâmetros:
product_id | ID do produto que deseja pegar os adicionais |
---|
Exemplo de resposta:
Bloco de código |
---|
{ "data": [] } |
...
Endpoint: DELETE /api/store/cart-item/{cart_item_id}/
Parâmetros:
cart_item_id | ID do “CartItem” |
---|
Headers:
x-cart-token | Token do carrinho | String |
---|
Exemplo de resposta:
Status Code 204 No Content
...
Endpoint: GET /api/store/cart/{cart_id}/?include=billing_address%2Cshipping_address%2Cshipping_method%2Ccontract_period%2Corigin%2Citems.product%2Citems.product.categories%2Citems.product.product_type%2Cuser%2Cbilling_address%2Cshipping_address
Parâmetros:
cart_id | ID do carrinho que deseja |
---|
Exemplo de resposta:
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1054", "attributes": { "taxes": "0.00", "discount": "-19.90", "monthly_period_availability": 0, "savings": null, "shipping_method_extra_data": {}, "total": "825.09", "available_shipping_methods": [], "shipping_price": "0.00", "has_variable_weight": false, "total_without_monthly_period": "44.99", "total_weight": "0.0 kg", "total_monthly_period": {}, "is_shipping_required": false, "extra_data": { "rg": "3283823782378", "cpf": "993.464.350-20", "dob": "01/01/2000", "fees": { "305596341G": "<span>R$-19.90<span>", "tax_instal": "<span>R$800.00<span>" }, "condo": "", "dueDay": 10, "mobile": "(14) 98198-3853", "city_id": "11", "message": "teste", "telephone": "(78) 32738-2738", "city_has_tv": true, "paymentType": "email", "condo_number": "", "contractTime": 2, "current_step": "2", "is_migration": false, "mobile_extra": "(87) 83728-7382", "plan_type_id": "1", "customer_type": "new", "city_has_fiber": true, "city_has_phone": false, "city_has_radio": false, "migration_type": null, "has_hidden_product": false, "current_wizard_step": "2", "photo_identity_array": [ { "document": "Selfie", "media_id": "649", "media_url": "https://storage.googleapis.com/wda-develop/secure/2022/2/4c511748079505b25ffdb3d13e37a0bf.png", "document_id": "1", "media_extension": "png" }, { "document": "Documento de identidade", "media_id": "650", "media_url": "https://storage.googleapis.com/wda-develop/secure/2022/2/725e6adc84d99ef99a7cdc8a8fd5d3e3.png", "document_id": "2", "media_extension": "png" }, { "document": "Comprovante de residência", "media_id": "651", "media_url": "https://storage.googleapis.com/wda-develop/secure/2022/2/86422b899764006fcb9f1f9d7b473879.png", "document_id": "3", "media_extension": "png" }, { "document": "Mais um", "media_id": "652", "media_url": "https://storage.googleapis.com/wda-develop/secure/2022/2/c5ba72b6623c8585778f24a7b0ac6a38.png", "document_id": "7", "media_extension": "png" } ] }, "payment_method_extra_data": {}, "fees": "800.00", "subtotal": "44.99", "created": "2022-02-22T14:53:34.768786-03:00", "updated": "2022-02-23T11:48:07.181997-03:00", "email": "marioli@gmail.com", "token": "300e1eaa-bb9c-4aef-8343-2bebf2a87ea5", "total_quantity": 0, "status": "active", "booking_deadline": null, "note": "", "voucher_code": "305596341G" }, "relationships": { "shipping_method": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/shipping_method/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/shipping_method/" }, "data": null }, "payment_method": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/payment_method/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/payment_method/" }, "data": null }, "warehouse": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/warehouse/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/warehouse/" }, "data": null }, "billing_address": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/billing_address/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/billing_address/" }, "data": { "type": "Address", "id": "675" } }, "items": { "meta": { "count": 3 }, "data": [ { "type": "CartItem", "id": "2392" }, { "type": "CartItem", "id": "2374" }, { "type": "CartItem", "id": "2373" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/items/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/items/" } }, "user": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/user/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/user/" }, "data": null }, "shipping_address": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/shipping_address/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/shipping_address/" }, "data": { "type": "Address", "id": "675" } }, "terms": { "meta": { "count": 1 }, "data": [ { "type": "CartTerm", "id": "7" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/terms/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/terms/" } }, "origin": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/origin/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/origin/" }, "data": { "type": "Origin", "id": "4" } }, "contract_period": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/contract_period/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/contract_period/" }, "data": { "type": "CartContractPeriod", "id": "3" } }, "booking_slot": { "links": { "self": "http://devisp.datacake.com.br/api/store/caomert/1054/relationships/booking_slot/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/booking_slot/" }, "data": null } } }, "included": [ { "type": "Address", "id": "675", "attributes": { "created": "2022-02-22T14:53:34.543509-03:00", "updated": "2022-02-23T11:48:05.886913-03:00", "nickname": "", "first_name": "Nome", "last_name": "Sobrenome", "company_name": null, "number": "00000", "street_address_1": "Rua São Pedro", "street_address_2": "Casa", "street_address_3": "Centro", "city": "Lençóis Paulista", "state": "SP", "postal_code": "18680-049", "country": "BR", "country_area": "BR", "phone": "", "is_default": null, "type": "billing", "latitude": "", "longitude": "" }, "relationships": { "user": { "links": { "self": "http://devisp.datacake.com.br/api/address/675/relationships/user/", "related": "http://devisp.datacake.com.br/api/address/675/user/" }, "data": null } } }, { "type": "CartContractPeriod", "id": "3", "attributes": { "created": "2022-01-04T11:39:01.915108-02:00", "updated": "2022-01-04T11:39:01.915190-02:00", "all_carts": true, "enabled": true, "content": "2 anos", "position": 2 }, "relationships": { "products": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/cart-term/3/relationships/products/", "related": "http://devisp.datacake.com.br/api/store/cart-term/3/products/" } } } }, { "type": "CartItem", "id": "2373", "attributes": { "base_price": "49.99", "quantity": 1, "discount": "-5.00", "total_without_discount": "49.99", "price": "44.99", "total": "44.99", "is_shipping_required": false, "unit_type": "regular", "data": { "discount_rules": { "5_boleto": "-5.00" } }, "name": "Internet Normalzinha", "sku": "int-normal-lp", "created": "2022-02-22T15:31:47.410017-03:00", "updated": "2022-02-23T09:49:08.135105-03:00", "customer_notes": "" }, "relationships": { "product": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2373/relationships/product/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2373/product/" }, "data": { "type": "Product", "id": "50" } }, "cart": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2373/relationships/cart/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2373/cart/" }, "data": { "type": "Cart", "id": "1054" } } } }, { "type": "CartItem", "id": "2374", "attributes": { "base_price": "800.00", "quantity": 1, "discount": "0.00", "total_without_discount": null, "price": "800.00", "total": "800.00", "is_shipping_required": false, "unit_type": null, "data": { "name": "Taxa de instalação", "price": "800.00", "rule_id": 1, "voucher": "tax_instal" }, "name": "Taxa de instalação", "sku": "tax_instal", "created": "2022-02-22T15:31:48.736354-03:00", "updated": "2022-02-23T09:49:07.825932-03:00", "customer_notes": "" }, "relationships": { "product": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2374/relationships/product/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2374/product/" }, "data": null }, "cart": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2374/relationships/cart/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2374/cart/" }, "data": { "type": "Cart", "id": "1054" } } } }, { "type": "CartItem", "id": "2392", "attributes": { "base_price": "-19.90", "quantity": 1, "discount": "0.00", "total_without_discount": null, "price": "-19.90", "total": "-19.90", "is_shipping_required": false, "unit_type": null, "data": { "name": "Cupom Datacake", "price": "-19.90", "rule_id": 49, "voucher": "305596341G" }, "name": "Cupom Datacake", "sku": "305596341G", "created": "2022-02-23T09:49:08.504375-03:00", "updated": "2022-02-23T09:49:08.504446-03:00", "customer_notes": "" }, "relationships": { "product": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2392/relationships/product/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2392/product/" }, "data": null }, "cart": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2392/relationships/cart/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2392/cart/" }, "data": { "type": "Cart", "id": "1054" } } } }, { "type": "Origin", "id": "4", "attributes": { "name": "Indicação de amigo/conhecido", "code": "indicacao-de-amigoconhecido", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Product", "id": "50", "attributes": { "more_like_this": "/api/store/product/mlt/50/", "extra_attributes": [], "hide_customer_notes": false, "pricing_sorting": "49.99", "option_required": false, "pricing_list": "49.99", "exclusive_pricing_sale": null, "kilogram_price": "49.99", "weight": null, "price": "49.99", "data": { "ribbon": null, "upload": "20", "download": "100", "sub_title": null, "thumbnail": null, "upload_icon": null, "addon_icon_1": null, "addon_icon_2": null, "addon_icon_3": null, "addon_icon_4": null, "addon_text_1": null, "addon_text_2": null, "addon_text_3": null, "addon_text_4": null, "checkout_icon": null, "display_title": "Internet", "download_icon": null, "franquia_dado": null, "is_best_seller": null, "addon_icon_cart_1": null, "addon_icon_cart_2": null, "addon_icon_cart_3": null, "addon_icon_cart_4": null, "addon_text_cart_1": null, "addon_text_cart_2": null, "addon_text_cart_3": null, "addon_text_cart_4": null, "short_description": null }, "first_image_alt": null, "base_price": "49.99", "attributes": null, "pricing_sale": null, "variant_attributes": null, "is_favorite": false, "cost": null, "first_image": null, "created": "2022-02-16T17:18:06.477206-02:00", "updated": "2022-02-16T17:18:06.477301-02:00", "is_active": true, "language": "en", "translation": {}, "sku": "int-normal-lp", "name": "Internet Normalzinha", "description": "Internet normal", "brand": null, "package": null, "available_on": null, "visibility": "all", "track_inventory": true, "quantity": 1, "quantity_allocated": 0, "shipping_width": null, "shipping_height": null, "shipping_depth": null, "is_in_promotion": false, "is_in_exclusive_promotion": false, "has_image": false, "restricted_customers": false, "variable_weight": false, "min_stock": 0.0, "unit_type": "regular", "position": 5, "product_class": "simple", "internal_product_code": null, "channel_count": 0, "channel_hd_count": 0, "channel_audio_count": 0 }, "relationships": { "inventory": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/inventory/", "related": "http://devisp.datacake.com.br/api/store/product/50/inventory/" } }, "variant_parent": { "data": null, "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/variant_parent/", "related": "http://devisp.datacake.com.br/api/store/product/50/variant_parent/" } }, "tags": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/tags/", "related": "http://devisp.datacake.com.br/api/store/product/50/tags/" } }, "current_inventory": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/current_inventory/", "related": "http://devisp.datacake.com.br/api/store/product/50/current_inventory/" }, "data": null }, "categories": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/categories/", "related": "http://devisp.datacake.com.br/api/store/product/50/categories/" } }, "addons": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/addons/", "related": "http://devisp.datacake.com.br/api/store/product/50/addons/" } }, "product_type": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/product_type/", "related": "http://devisp.datacake.com.br/api/store/product/50/product_type/" }, "data": { "type": "ProductType", "id": "4" } }, "bundle_products": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/bundle_products/", "related": "http://devisp.datacake.com.br/api/store/product/50/bundle_products/" } }, "images": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/images/", "related": "http://devisp.datacake.com.br/api/store/product/50/images/" } }, "options": { "links": { "self": "http://devisp.datacake.com.br/api/store/product/50/relationships/options/", "related": "http://devisp.datacake.com.br/api/store/product/50/options/" }, "data": null } } }, { "type": "ProductType", "id": "4", "attributes": { "weight": "0.0 kg", "created": "2021-01-12T00:22:00.990090-02:00", "updated": "2021-02-03T17:47:44.254117-02:00", "product_class": "simple", "name": "Internet Fibra", "code": "fiber", "has_variants": true, "is_shipping_required": false }, "relationships": { "data": { "meta": { "count": 28 }, "data": [ { "type": "ProductAttribute", "id": "41" }, { "type": "ProductAttribute", "id": "40" }, { "type": "ProductAttribute", "id": "39" }, { "type": "ProductAttribute", "id": "38" }, { "type": "ProductAttribute", "id": "37" }, { "type": "ProductAttribute", "id": "36" }, { "type": "ProductAttribute", "id": "35" }, { "type": "ProductAttribute", "id": "34" }, { "type": "ProductAttribute", "id": "31" }, { "type": "ProductAttribute", "id": "28" }, { "type": "ProductAttribute", "id": "27" }, { "type": "ProductAttribute", "id": "17" }, { "type": "ProductAttribute", "id": "16" }, { "type": "ProductAttribute", "id": "15" }, { "type": "ProductAttribute", "id": "14" }, { "type": "ProductAttribute", "id": "13" }, { "type": "ProductAttribute", "id": "12" }, { "type": "ProductAttribute", "id": "11" }, { "type": "ProductAttribute", "id": "10" }, { "type": "ProductAttribute", "id": "9" }, { "type": "ProductAttribute", "id": "8" }, { "type": "ProductAttribute", "id": "7" }, { "type": "ProductAttribute", "id": "6" }, { "type": "ProductAttribute", "id": "5" }, { "type": "ProductAttribute", "id": "4" }, { "type": "ProductAttribute", "id": "3" }, { "type": "ProductAttribute", "id": "2" }, { "type": "ProductAttribute", "id": "1" } ], "links": { "self": "http://devisp.datacake.com.br/api/store/product-type/4/relationships/data/", "related": "http://devisp.datacake.com.br/api/store/product-type/4/data/" } } } } ] } |
...
Endpoint: PATCH /api/store/cart/{cart_id}/
Parâmetros:
cart_id | ID do carrinho |
---|
Atributos:
id | ID do carrinho | String |
---|---|---|
voucher_code | CUPOM | String |
Exemplo:
Body:
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1054", "attributes": { "id": "1054", "voucher_code": "123456" } } } |
...
Endpoint: PATCH /api/store/cart/{cart_id}/
Parâmetros:
cart_id | ID do carrinho |
---|
Atributos:
id | ID do carrinho | String |
---|---|---|
voucher_code | CUPOM | String |
Exemplo:
Body:
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1054", "attributes": { "id": "1054", "voucher_code": "" } } } |
...
Endpoint: GET /api/store/origin/?filter[is_active]={is_active}&page[size]={page_size}&page[number]={page_number}
Parâmetros:
is_active | Filtra se quer apenas ativo ou apenas desativado | Boolean |
---|---|---|
page |
[size] | Quantidades de itens por página | Number |
---|---|---|
page |
[number] | Qual página deseja pegas as informações | Number |
---|
Exemplo de resposta:
Bloco de código |
---|
{ "links": { "first": "http://devisp.datacake.com.br/api/store/origin/?filter%5Bis_active%5D=true&page%5Bnumber%5D=1&page%5Bsize%5D=25", "last": "http://devisp.datacake.com.br/api/store/origin/?filter%5Bis_active%5D=true&page%5Bnumber%5D=1&page%5Bsize%5D=25", "next": null, "prev": null }, "data": [ { "type": "Origin", "id": "1", "attributes": { "name": "Google", "code": "google", "erp_code": "2", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "2", "attributes": { "name": "Facebook", "code": "facebook", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "3", "attributes": { "name": "Carro de Som", "code": "carro-de-som", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "4", "attributes": { "name": "Indicação de amigo/conhecido", "code": "indicacao-de-amigoconhecido", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "5", "attributes": { "name": "Radio", "code": "radio", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "6", "attributes": { "name": "Televisão", "code": "televisao", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "7", "attributes": { "name": "Folheto", "code": "folheto", "erp_code": "", "position": 0, "is_active": true, "website": true } }, { "type": "Origin", "id": "11", "attributes": { "name": "Eventos", "code": "eventos", "erp_code": "11", "position": 99, "is_active": true, "website": true } }, ], "meta": { "pagination": { "page": 1, "pages": 1, "count": 8 } } } |
...
Endpoint: /api/store/bank/?page[size]={page_size}&page[number]={page_number}
Parâmetros:
page |
---|
[size] | Quantidades de itens por página | Number |
---|---|---|
page |
[number] | Qual página deseja pegas as informações | Number |
---|
Exemplo de resposta:
Bloco de código |
---|
{ "links": { "first": "http://devisp.datacake.com.br/api/store/bank/?page%5Bnumber%5D=1&page%5Bsize%5D=5", "last": "http://devisp.datacake.com.br/api/store/bank/?page%5Bnumber%5D=57&page%5Bsize%5D=5", "next": "http://devisp.datacake.com.br/api/store/bank/?page%5Bnumber%5D=2&page%5Bsize%5D=5", "prev": null }, "data": [ { "type": "Bank", "id": "246", "attributes": { "name": "Acesso Soluções de Pagamento S.A.", "code": 332, "extra_data": {}, "internal_bank_code": null } }, { "type": "Bank", "id": "212", "attributes": { "name": "Advanced Cc Ltda", "code": 117, "extra_data": {}, "internal_bank_code": null } }, { "type": "Bank", "id": "215", "attributes": { "name": "AGK Corretora de Câmbio S.A.", "code": 272, "extra_data": {}, "internal_bank_code": null } }, { "type": "Bank", "id": "258", "attributes": { "name": "AL5 S.A. CRÉDITO, FINANCIAMENTO E INVESTIMENTO", "code": 349, "extra_data": {}, "internal_bank_code": null } }, { "type": "Bank", "id": "59", "attributes": { "name": "Albatross Ccv S.A.", "code": 172, "extra_data": {}, "internal_bank_code": null } } ], "meta": { "pagination": { "page": 1, "pages": 57, "count": 285 } } } |
...
Endpoint: GET /api/provider/city/{{city_id}}/?fields=due_dates&include=due_dates
Parâmetros:
city_id | ID da cidade |
---|
Exemplo de resposta:
Bloco de código |
---|
{ "data": { "type": "City", "id": "11", "attributes": {}, "relationships": { "due_dates": { "meta": { "count": 9 }, "data": [ { "type": "DueDate", "id": "6" }, { "type": "DueDate", "id": "5" }, { "type": "DueDate", "id": "4" }, { "type": "DueDate", "id": "3" }, { "type": "DueDate", "id": "2" }, { "type": "DueDate", "id": "1" }, { "type": "DueDate", "id": "8" }, { "type": "DueDate", "id": "7" }, { "type": "DueDate", "id": "9" } ], "links": { "self": "http://devisp.datacake.com.br/api/provider/city/11/relationships/due_dates/", "related": "http://devisp.datacake.com.br/api/provider/city/11/due_dates/" } } } }, "included": [ { "type": "DueDate", "id": "1", "attributes": { "internal_due_date_code": null, "day": 5, "extra_data": {} } }, { "type": "DueDate", "id": "2", "attributes": { "internal_due_date_code": null, "day": 10, "extra_data": {} } }, { "type": "DueDate", "id": "3", "attributes": { "internal_due_date_code": null, "day": 15, "extra_data": {} } }, { "type": "DueDate", "id": "4", "attributes": { "internal_due_date_code": null, "day": 20, "extra_data": {} } }, { "type": "DueDate", "id": "5", "attributes": { "internal_due_date_code": "25", "day": 25, "extra_data": {} } }, { "type": "DueDate", "id": "6", "attributes": { "internal_due_date_code": null, "day": 30, "extra_data": {} } }, { "type": "DueDate", "id": "7", "attributes": { "internal_due_date_code": null, "day": 2, "extra_data": {} } }, { "type": "DueDate", "id": "8", "attributes": { "internal_due_date_code": null, "day": 3, "extra_data": {} } }, { "type": "DueDate", "id": "9", "attributes": { "internal_due_date_code": null, "day": 1, "extra_data": {} } } ] } |
...
Endpoint: GET /api/store/cart-term/?carts={{cart_id}}&fields=id,content
Parâmetros:
cart_id | ID do carrinho |
---|
Exemplo de resposta:
Bloco de código | ||
---|---|---|
| ||
{ "links": { "first": "http://devisp.datacake.com.br/api/store/cart-term/?carts=1117&fields=id%2Ccontent&page%5Bnumber%5D=1", "last": "http://devisp.datacake.com.br/api/store/cart-term/?carts=1117&fields=id%2Ccontent&page%5Bnumber%5D=1", "next": null, "prev": null }, "data": [ { "type": "CartTerm", "id": "7", "attributes": { "content": "Eu declaro que sou responsável pelo endereço de instalação citado & Aceito as condições do serviço descrito acima." } } ], "meta": { "pagination": { "page": 1, "pages": 1, "count": 1 } } } |
...
Endpoint GET /api/store/cart/{cart_id}/complete_order/
Parâmetros:
cart_id | ID do carrinho que deseja finalizar o pedido |
---|
Exemplo de resposta:
Bloco de código | ||
---|---|---|
| ||
{ "data": { "type": "Cart", "id": "375", "attributes": { "total_lines_problems": 0, "taxes": "0.00", "discount_amount": "0.00", "reseller_id": null, "shipping_method_extra_data": {}, "total": "49.99", "has_unsolved_problems": false, "shipping_price": "0.00", "status": "draft", "total_without_monthly_period": "49.99", "total_lines_fulfillment_done": 0, "payment_method_extra_data": {}, "total_lines": 1, "total_lines_without_problems": 1, "has_problems": false, "subtotal": "49.99", "created": "2022-02-25T11:33:37.132109-03:00", "updated": "2022-02-25T11:33:37.132171-03:00", "order_num": "2022225-1116-374", "user_email": "sffdfdf@sddfdf", "extra_data": { "rg": "343434343434", "cpf": "788.177.420-74", "dob": "01/01/2000", "fees": {}, "condo": "", "dueDay": 15, "mobile": "(54) 45454-5455", "city_id": "11", "message": "", "telephone": "", "city_has_tv": true, "paymentType": "email", "condo_number": "", "contractTime": 2, "current_step": "2", "is_migration": false, "mobile_extra": "", "plan_type_id": "1", "customer_type": "new", "city_has_fiber": true, "city_has_phone": false, "city_has_radio": false, "migration_type": null, "has_hidden_product": false, "current_wizard_step": "2", "item_count": 1 }, "security_data": { "HTTP_USER_AGENT": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36", "REMOTE_ADDR": "189.50.106.42" }, "extra_payment_data": null, "contract_period": { "id": 3, "content": "2 anos" }, "terms": [ { "id": 7, "content": "Eu declaro que sou responsável pelo endereço de instalação citado & Aceito as condições do serviço descrito acima." } ], "token": "f7fe874d-c782-42cc-8ec3-4cd9f379048a", "shipping_method_name": null, "customer_note": "", "voucher_code": null, "monthly_period_availability": 0, "remote_id": null }, "relationships": { "step": { "links": { "self": "/api/store/order/375/relationships/step/", "related": "/api/store/order/375/step/" }, "data": null }, "shipping_method": { "links": { "self": "/api/store/cart/375/relationships/shipping_method/", "related": "/api/store/cart/375/shipping_method/" }, "data": null }, "lines": { "meta": { "count": 1 }, "data": [ { "type": "OrderLine", "id": "989" } ], "links": { "self": "/api/store/order-line/375/relationships/lines/", "related": "/api/store/order-line/375/lines/" } }, "payment_method": { "links": { "self": "/api/store/cart/375/relationships/payment_method/", "related": "/api/store/cart/375/payment_method/" }, "data": null }, "warehouse": { "links": { "self": "/api/store/order/375/relationships/warehouse/", "related": "/api/store/order/375/warehouse/" }, "data": null }, "billing_address": { "links": { "self": "/api/store/order-line/375/relationships/billing_address/", "related": "/api/store/order-line/375/billing_address/" }, "data": { "type": "Address", "id": "731" } }, "collector_assigned": { "links": { "self": "/api/store/order/375/relationships/collector_assigned/", "related": "/api/store/order/375/collector_assigned/" }, "data": null }, "user": { "links": { "self": "/api/store/order-line/375/relationships/user/", "related": "/api/store/order-line/375/user/" }, "data": null }, "packer_assigned": { "links": { "self": "/api/store/order/375/relationships/packer_assigned/", "related": "/api/store/order/375/packer_assigned/" }, "data": null }, "shipping_address": { "links": { "self": "/api/store/order-line/375/relationships/shipping_address/", "related": "/api/store/order-line/375/shipping_address/" }, "data": { "type": "Address", "id": "731" } }, "deliveryman_assigned": { "links": { "self": "/api/store/order/375/relationships/deliveryman_assigned/", "related": "/api/store/order/375/deliveryman_assigned/" }, "data": null }, "origin": { "links": { "self": "/api/store/order/375/relationships/origin/", "related": "/api/store/order/375/origin/" }, "data": { "type": "Origin", "id": "2" } }, "booking_slot": { "links": { "self": "/api/store/cart/375/relationships/booking_slot/", "related": "/api/store/cart/375/booking_slot/" }, "data": null }, "website": { "data": { "type": "Website", "id": "1" } } } } } |
...
Endpoint: PATCH /api/store/cart/{cart_id}/?include=billing_address,shipping_address,shipping_method,contract_period,origin,items.product,items.product.categories
Parâmetros:
cart_id | ID do carrinho |
---|
Exemplo:
body:
Bloco de código |
---|
{ "data": { "relationships": { "items": { "data": [ { "type": "CartItem", "id": "2405" } ] }, "terms": { "data": [] }, "billing_address": { "data": { "type": "Address", "id": "697" } }, "shipping_address": { "data": { "type": "Address", "id": "697" } }, "contract_period": { "data": { "type": "CartContractPeriod", "id": "3" } }, "origin": { "data": { "type": "Origin", "id": "4" } } }, "type": "Cart", "id": "1081", "attributes": { "extra_data": { "reseller_id": "53", "condo": "", "mobile": "(56) 56565-6565", "city_id": "11", "city_has_tv": true, "paymentType": "email", "condo_number": "", "contractTime": 2, "current_step": "2", "is_migration": false, "plan_type_id": "1", "customer_type": "new", "city_has_fiber": true, "city_has_phone": false, "city_has_radio": false, "migration_type": null, "has_hidden_product": false, "current_wizard_step": "2", "cpf": "519.120.340-26", "rg": "888788787887", "mobile_extra": "(43) 43434-3434", "telephone": "(32) 32323-2332", "dob": "01/01/2000", "message": "222", "fees": {}, "photo_identity_array": [ { "media_id": "659", "media_extension": "png", "media_url": "https://storage.googleapis.com/wda-develop/secure/2022/2/65b57a25e490a8e0422d39e5ee38cf8f.png", "document": "Selfie", "document_id": "1" } ] } } } } |
...