...
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
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:
Possibilita pegar informações como rua, bairro, cidade e outras informações a partir do 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": "" } } } |
Checagem inicial de cobertura na cidade do cliente:
Permite fazer uma verificação se existe cobertura em uma cidade, pelo CEP.
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:
Bloco de código |
---|
{ "data": { "type": "City", "id": "11", "attributes": { "neighborhood": "Jardim São João", "state": "SP", "postal_code": "18680-410", "street": "Avenida José Antônio Lorenzetti", "created": "2021-08-19T19:37:43.708091-03:00", "updated": "2022-02-16T17:31:40.001758-02:00", "name": "Lençóis Paulista", "short_name": "Lençóis Paulista", "code": "lencoisPaulista", "lat": "-22.6036000", "long": "-48.7975000", "redirect_url": null, "due_date": null, "is_neighborhood": false, "neighborhood_name": null }, "relationships": { "postal_codes": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/provider/city/11/relationships/postal_codes/", "related": "http://devisp.datacake.com.br/api/provider/city/11/postal_codes/" } }, "streets": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/provider/city/11/relationships/streets/", "related": "http://devisp.datacake.com.br/api/provider/city/11/streets/" } }, "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/" } }, "products": { "meta": { "count": 3 }, "data": [ { "type": "Product", "id": "51" }, { "type": "Product", "id": "50" }, { "type": "Product", "id": "42" } ], "links": { "self": "http://devisp.datacake.com.br/api/provider/city/11/relationships/products/", "related": "http://devisp.datacake.com.br/api/provider/city/11/products/" } }, "integration": { "links": { "self": "http://devisp.datacake.com.br/api/provider/city/11/relationships/integration/", "related": "http://devisp.datacake.com.br/api/provider/city/11/integration/" }, "data": { "type": "Integration", "id": "9" } } } } } |
Caso não exista cobertura no CEP informado, retornara uma mensagem de erro, com o status 404:
Bloco de código |
---|
{ "errors": [ { "detail": "Desculpe, infelizmente não temos cobertura na cidade Manaus CEP:69015-754", "status": "404", "source": { "pointer": "/data" }, "code": "not_found" } ] } |
Checagem financeira
Permite verificar se o usuário possui restriçoes.
Endpoint: POST /api/store/cart/pre_check/
Atributos:
taxvat | CPF | String |
---|---|---|
token | Token | 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 } |
...
KMZ:
Pegar coordenadas de um endereço:
Possibilita pegar as coordenas de um local pelo endereço.
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 | ||
---|---|---|
| ||
{ "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 } } |
Pegar endereço pelas coordenadas:
Permite pegas as informações de um endereço através de coordenadas
Endpoint: POST /api/provider/coverage/address/
Atributos:
latitude | Number | |
---|---|---|
longitude | Number |
Exemplo:
Body:
Bloco de código |
---|
{ "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" } } |
Verificar cobertura de um endereço:
Permite verificar se existe cobertura em um endereço
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 |
---|
{ "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:
Bloco de código |
---|
{ "data": { "coverage": { "polygons": [ { "name": "LENÇÓIS", "source": "KMZ" } ] } } } |
Caso não tenha cobertura retornará uma mensagem de erro, e o status 400:
Bloco de código |
---|
{ "errors": [ { "detail": "No Coverage", "status": "400", "source": { "pointer": "/data" }, "code": "400001" } ] } |
...
Checkout:
Salvar endereço do cliente:
Permite salvar um endereço
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 |
---|
{ "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 } } } } |
Criação de carrinho:
Permite criar o carrinho, para iniciar o processo de compra.
Endpoint: POST /api/store/cart/?include=billing_address,shipping_address
Atributos:
extra_data | JSON | |
---|---|---|
String |
Atributos do “extra_data”:
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": { "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" } } } |
Resposta:
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1108", "attributes": { "taxes": "0.00", "discount": "-0.00", "monthly_period_availability": 0, "savings": null, "shipping_method_extra_data": null, "total": "0.00", "available_shipping_methods": null, "shipping_price": "0.00", "has_variable_weight": false, "total_without_monthly_period": "0.00", "total_weight": "0.0 kg", "total_monthly_period": {}, "is_shipping_required": false, "extra_data": { "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 }, "payment_method_extra_data": null, "fees": "0.00", "subtotal": "0.00", "created": "2022-02-24T15:13:30.871781-03:00", "updated": "2022-02-24T15:13:30.871882-03:00", "email": "Emailteste@gmail.com", "token": "5344e087-8101-4d60-bdd2-adc827ebd9a6", "total_quantity": 0, "status": "active", "booking_deadline": null, "note": "", "voucher_code": null }, "relationships": { "shipping_method": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/shipping_method/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/shipping_method/" }, "data": null }, "payment_method": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/payment_method/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/payment_method/" }, "data": null }, "warehouse": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/warehouse/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/warehouse/" }, "data": null }, "billing_address": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/billing_address/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/billing_address/" }, "data": { "type": "Address", "id": "675" } }, "items": { "meta": { "count": 0 }, "data": [], "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/items/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/items/" } }, "user": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/user/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/user/" }, "data": null }, "shipping_address": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/shipping_address/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/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/1108/relationships/terms/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/terms/" } }, "origin": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/origin/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/origin/" }, "data": null }, "contract_period": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/contract_period/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/contract_period/" }, "data": null }, "booking_slot": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1108/relationships/booking_slot/", "related": "http://devisp.datacake.com.br/api/store/cart/1108/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": "198", "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 } } } ] } |
Pegar contratos disponíveis:
Permite obter os contratos disponíveis.
Endpoint: GET /api/store/cart-contract-period/get_cart_contract_period/
Exemplo de resposta:
Bloco de código |
---|
{ "data": [ { "type": "CartContractPeriod", "id": "1", "attributes": { "created": "2021-02-18T11:09:49.264456-02:00", "updated": "2021-02-18T11:09:49.264505-02:00", "all_carts": true, "enabled": true, "content": "Sem Fidelidade", "position": 0 }, "relationships": { "products": { "meta": { "count": 0 }, "data": [], "links": { "self": "/api/store/cart-term/1/relationships/products/", "related": "/api/store/cart-term/1/products/" } } } }, { "type": "CartContractPeriod", "id": "2", "attributes": { "created": "2021-02-18T11:10:04.494635-02:00", "updated": "2021-02-18T11:10:04.494686-02:00", "all_carts": true, "enabled": true, "content": "1 ano", "position": 1 }, "relationships": { "products": { "meta": { "count": 0 }, "data": [], "links": { "self": "/api/store/cart-term/2/relationships/products/", "related": "/api/store/cart-term/2/products/" } } } }, { "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": "/api/store/cart-term/3/relationships/products/", "related": "/api/store/cart-term/3/products/" } } } } ] } |
Pegar os planos disponíveis:
Possibilita pegar os planos disponíveis na cidade
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 } } } |
Adição de produto no carrinho:
Possibilita adicionar produto ao carrinho.
Endpoint: POST /api/store/cart-item/?include=product%2Ccart%2Ccart.items%2Ccart.items.product
Atributos:
quantity | Quantidade do produto | Number |
---|
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 } } } |
Resposta:
Bloco de código |
---|
{ "data": { "type": "CartItem", "id": "2373", "attributes": { "base_price": "49.99", "quantity": 2, "discount": "-5.00", "total_without_discount": "99.98", "price": "44.99", "total": "89.98", "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-25T14:37:07.191623-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" } } } }, "included": [ { "type": "Cart", "id": "1054", "attributes": { "taxes": "0.00", "discount": "-19.90", "monthly_period_availability": 0, "savings": null, "shipping_method_extra_data": {}, "total": "870.08", "available_shipping_methods": [], "shipping_price": "0.00", "has_variable_weight": false, "total_without_monthly_period": "89.98", "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": "89.98", "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/cart/1054/relationships/booking_slot/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/booking_slot/" }, "data": null } } }, { "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": "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 } } } ] } |
Pegar os adicionais de um produto:
Permite pegar os adicionais de um produto
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": [] } |
Remoção de um produto do carrinho:
Permite remover produto do carrinho.
Endpoint: DELETE /api/store/cart-item/{cart_item_id}/
Parâmetros:
cart_item_id | ID do “CartItem” |
---|
Exemplo de resposta:
Status Code 204 No Content
Pegar carrinho:
Possibilita pegar o carrinho.
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/" } } } } ] } |
Aplicar cupom:
Permite aplicar cupom de desconto. Ele adiciona o cupom atualizando o carrinho.
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" } } } |
Resposta Cupom valido (retorna o carrinho):
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1054", "attributes": { "fees": "800.00", "shipping_price": "0.00", "extra_data": { "cpf": "993.464.350-20", "condo": "", "mobile": "(14) 98198-3853", "city_id": "11", "city_has_tv": true, "paymentType": "email", "condo_number": "", "contractTime": 2, "current_step": "1", "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": "1" }, "shipping_method_extra_data": {}, "subtotal": "44.99", "total": "825.09", "available_shipping_methods": [], "total_without_monthly_period": "44.99", "taxes": "0.00", "is_shipping_required": false, "discount": "-19.90", "total_weight": "0.0 kg", "total_monthly_period": {}, "savings": null, "monthly_period_availability": 0, "has_variable_weight": false, "payment_method_extra_data": {}, "created": "2022-02-22T14:53:34.768786-03:00", "updated": "2022-02-23T09:42:39.639681-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": { "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 }, "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 }, "booking_slot": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/booking_slot/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/booking_slot/" }, "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" } }, "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 }, "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/" } }, "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" } }, "items": { "meta": { "count": 3 }, "data": [ { "type": "CartItem", "id": "2388" }, { "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/" } }, "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": 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" } }, "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 } } }, "included": [ { "type": "Address", "id": "675", "attributes": { "created": "2022-02-22T14:53:34.543509-03:00", "updated": "2022-02-22T15:19:50.538600-03:00", "nickname": "", "first_name": "Marizete", "last_name": "OliveirA", "company_name": null, "number": "198", "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/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": { "total": "44.99", "quantity": 1, "is_shipping_required": false, "data": { "discount_rules": { "5_boleto": "-5.00" } }, "total_without_discount": "49.99", "price": "44.99", "name": "Internet Normalzinha", "unit_type": "regular", "sku": "int-normal-lp", "base_price": "49.99", "discount": "-5.00", "created": "2022-02-22T15:31:47.410017-03:00", "updated": "2022-02-23T09:42:40.643099-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": { "total": "800.00", "quantity": 1, "is_shipping_required": false, "data": { "name": "Taxa de instalação", "price": "800.00", "rule_id": 1, "voucher": "tax_instal" }, "total_without_discount": null, "price": "800.00", "name": "Taxa de instalação", "unit_type": null, "sku": "tax_instal", "base_price": "800.00", "discount": "0.00", "created": "2022-02-22T15:31:48.736354-03:00", "updated": "2022-02-23T09:42:40.299807-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": "2388", "attributes": { "total": "-19.90", "quantity": 1, "is_shipping_required": false, "data": { "name": "Cupom Datacake", "price": "-19.90", "rule_id": 49, "voucher": "305596341G" }, "total_without_discount": null, "price": "-19.90", "name": "Cupom Datacake", "unit_type": null, "sku": "305596341G", "base_price": "-19.90", "discount": "0.00", "created": "2022-02-23T09:42:40.990966-03:00", "updated": "2022-02-23T09:42:40.991019-03:00", "customer_notes": "" }, "relationships": { "product": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2388/relationships/product/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2388/product/" }, "data": null }, "cart": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2388/relationships/cart/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2388/cart/" }, "data": { "type": "Cart", "id": "1054" } } } }, { "type": "Product", "id": "50", "attributes": { "pricing_sale": null, "more_like_this": "/api/store/product/mlt/50/", "option_required": false, "hide_customer_notes": false, "variant_attributes": null, "base_price": "49.99", "kilogram_price": "49.99", "attributes": null, "weight": null, "pricing_list": "49.99", "cost": null, "extra_attributes": [], "exclusive_pricing_sale": null, "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 }, "is_favorite": false, "price": "49.99", "first_image_alt": null, "pricing_sorting": "49.99", "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, "unit_type": "regular", "position": 5, "product_class": "simple", "internal_product_code": null, "channel_count": 0, "channel_hd_count": 0, "channel_audio_count": 0 }, "relationships": { "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/" } }, "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/" } }, "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 }, "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 }, "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/" } }, "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" } }, "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/" } }, "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/" } }, "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/" } }, "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/" } } } } ] } |
Resposta Cupom invalido:
Bloco de código |
---|
{ "errors": [ { "detail": "voucher invalid", "status": "400", "source": { "pointer": "/data/attributes/non_field_errors" }, "code": "invalid" } ] } |
Remover Cupom:
Permite remover cupom de desconto. Ele remove o cupom atualizando o carrinho.
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": "" } } } |
Resposta (retorna o carrinho):
Bloco de código |
---|
{ "data": { "type": "Cart", "id": "1054", "attributes": { "fees": "800.00", "shipping_price": "0.00", "extra_data": { "cpf": "993.464.350-20", "condo": "", "mobile": "(14) 98198-3853", "city_id": "11", "city_has_tv": true, "paymentType": "email", "condo_number": "", "contractTime": 2, "current_step": "1", "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": "1" }, "shipping_method_extra_data": {}, "subtotal": "44.99", "total": "825.09", "available_shipping_methods": [], "total_without_monthly_period": "44.99", "taxes": "0.00", "is_shipping_required": false, "discount": "-19.90", "total_weight": "0.0 kg", "total_monthly_period": {}, "savings": null, "monthly_period_availability": 0, "has_variable_weight": false, "payment_method_extra_data": {}, "created": "2022-02-22T14:53:34.768786-03:00", "updated": "2022-02-23T09:42:39.639681-03:00", "email": "Marioli@gmail.com", "token": "300e1eaa-bb9c-4aef-8343-2bebf2a87ea5", "total_quantity": 0, "status": "active", "booking_deadline": null, "note": "", "voucher_code": "" }, "relationships": { "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 }, "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 }, "booking_slot": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart/1054/relationships/booking_slot/", "related": "http://devisp.datacake.com.br/api/store/cart/1054/booking_slot/" }, "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" } }, "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 }, "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/" } }, "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" } }, "items": { "meta": { "count": 3 }, "data": [ { "type": "CartItem", "id": "2388" }, { "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/" } }, "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": 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" } }, "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 } } }, "included": [ { "type": "Address", "id": "675", "attributes": { "created": "2022-02-22T14:53:34.543509-03:00", "updated": "2022-02-22T15:19:50.538600-03:00", "nickname": "", "first_name": "Marizete", "last_name": "OliveirA", "company_name": null, "number": "198", "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/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": { "total": "44.99", "quantity": 1, "is_shipping_required": false, "data": { "discount_rules": { "5_boleto": "-5.00" } }, "total_without_discount": "49.99", "price": "44.99", "name": "Internet Normalzinha", "unit_type": "regular", "sku": "int-normal-lp", "base_price": "49.99", "discount": "-5.00", "created": "2022-02-22T15:31:47.410017-03:00", "updated": "2022-02-23T09:42:40.643099-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": { "total": "800.00", "quantity": 1, "is_shipping_required": false, "data": { "name": "Taxa de instalação", "price": "800.00", "rule_id": 1, "voucher": "tax_instal" }, "total_without_discount": null, "price": "800.00", "name": "Taxa de instalação", "unit_type": null, "sku": "tax_instal", "base_price": "800.00", "discount": "0.00", "created": "2022-02-22T15:31:48.736354-03:00", "updated": "2022-02-23T09:42:40.299807-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": "2388", "attributes": { "total": "-19.90", "quantity": 1, "is_shipping_required": false, "data": { "name": "Cupom Datacake", "price": "-19.90", "rule_id": 49, "voucher": "305596341G" }, "total_without_discount": null, "price": "-19.90", "name": "Cupom Datacake", "unit_type": null, "sku": "305596341G", "base_price": "-19.90", "discount": "0.00", "created": "2022-02-23T09:42:40.990966-03:00", "updated": "2022-02-23T09:42:40.991019-03:00", "customer_notes": "" }, "relationships": { "product": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2388/relationships/product/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2388/product/" }, "data": null }, "cart": { "links": { "self": "http://devisp.datacake.com.br/api/store/cart-item/2388/relationships/cart/", "related": "http://devisp.datacake.com.br/api/store/cart-item/2388/cart/" }, "data": { "type": "Cart", "id": "1054" } } } }, { "type": "Product", "id": "50", "attributes": { "pricing_sale": null, "more_like_this": "/api/store/product/mlt/50/", "option_required": false, "hide_customer_notes": false, "variant_attributes": null, "base_price": "49.99", "kilogram_price": "49.99", "attributes": null, "weight": null, "pricing_list": "49.99", "cost": null, "extra_attributes": [], "exclusive_pricing_sale": null, "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 }, "is_favorite": false, "price": "49.99", "first_image_alt": null, "pricing_sorting": "49.99", "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, "unit_type": "regular", "position": 5, "product_class": "simple", "internal_product_code": null, "channel_count": 0, "channel_hd_count": 0, "channel_audio_count": 0 }, "relationships": { "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/" } }, "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/" } }, "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 }, "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 }, "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/" } }, "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" } }, "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/" } }, "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/" } }, "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/" } }, "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/" } } } } ] } |
Pegar dados do "Como você chegou até nós?":
Pega as informações do "Como você chegou até nós?".
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 } } } |
Pegar bancos:
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 } } } |
Pegar datas de vencimento de uma cidade:
Permite pegar as datas de vencimento de fatura de uma cidade.
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": {} } } ] } |
Pegar termos de um carrinho:
Possibilita pegar os termos dos produtos de um carrinho.
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 } } } |
Pegar documentos necessários:
Permite pegar a lista de documentos necessários para realizar o pedido.
Endpoint: GET /api/provider/document/
Exemplo de resposta:
Bloco de código |
---|
{ "links": { "first": "http://devisp.datacake.com.br/api/provider/document/?page%5Bnumber%5D=1", "last": "http://devisp.datacake.com.br/api/provider/document/?page%5Bnumber%5D=1", "next": null, "prev": null }, "data": [ { "type": "Document", "id": "1", "attributes": { "name": "Selfie", "description": "Precisamos confirmar sua identidade, por favor envie uma selfie. A imagem deve estar legível. Por isso, certifique-se de que a foto está nítida e que não possui cortes.", "image": "/assets/providerfy/images/document_selfie.png", "css_class": "", "required": false, "position": 0 } }, { "type": "Document", "id": "2", "attributes": { "name": "Documento de identidade", "description": "Agora precisamos que você envie um documento de identidade (RG ou CNH frente e verso). O documento deve estar legível. Por isso, certifique-se de que a foto está nítida e que não possui cortes.", "image": "/assets/providerfy/images/document_id.png", "css_class": "", "required": false, "position": 1 } }, { "type": "Document", "id": "3", "attributes": { "name": "Comprovante de residência", "description": "Precisamos que você envie um comprovante de residencia (conta de luz, água, telefone ou fatura do cartão). As informações na imagem devem estar legíveis. Por isso, certifique-se de que a foto e/ou scanner está nítida e que não possui cortes.", "image": "/assets/providerfy/images/document_residence.png", "css_class": "", "required": false, "position": 2 } }, { "type": "Document", "id": "7", "attributes": { "name": "Mais um", "description": "Mais um mais um", "image": null, "css_class": null, "required": true, "position": 4 } }, { "type": "Document", "id": "8", "attributes": { "name": "Mais um mais um", "description": "Mais um mais um mais um", "image": null, "css_class": null, "required": true, "position": 5 } }, { "type": "Document", "id": "9", "attributes": { "name": "Mais um mais um mais um", "description": "Mais um mais um mais um mais um", "image": null, "css_class": null, "required": true, "position": 6 } }, { "type": "Document", "id": "10", "attributes": { "name": "Mais um mais um mais um mais um mais um", "description": "Mais um mais um mais um mais um mais um", "image": null, "css_class": null, "required": true, "position": 7 } } ], "meta": { "pagination": { "page": 1, "pages": 1, "count": 7 } } } |
Conversão em pedido:
Permite finalizar o pedido
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" } } } } } |
Atualizar o carrinho
Permite atualizar o carrinho, para adicionar os documentos, adicionar dados faltando, alterar passo e outras alterações.
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": { "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" } ] } } } } |
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/cart/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": "Marizete", "last_name": "OliveirA", "company_name": null, "number": "198", "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/" } } } } ] } |
...