API Docs
Pedidos
/orders
1 min
code examples curl location '/orders' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "external id" "", "items" \[ { "id" "", "price" "", "description" "" } ], "document" "12345678901", "total" "", "payment methods" \[ { "id" "", "amount" "" } ] }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "external id" "", "items" \[ { "id" "", "price" "", "description" "" } ], "document" "12345678901", "total" "", "payment methods" \[ { "id" "", "amount" "" } ] }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("/orders", requestoptions) then(response => response text()) then(result => console log(result)) catch(error => console log('error', error));require "uri" require "json" require "net/http" url = uri("/orders") http = net http new(url host, url port); request = net http post new(url) request\["accept"] = "application/json" request\["content type"] = "application/json" request body = json dump({ "external id" "", "items" \[ { "id" "", "price" "", "description" "" } ], "document" "12345678901", "total" "", "payment methods" \[ { "id" "", "amount" "" } ] }) response = http request(request) puts response read body import requests import json url = "/orders" payload = json dumps({ "external id" "", "items" \[ { "id" "", "price" "", "description" "" } ], "document" "12345678901", "total" "", "payment methods" \[ { "id" "", "amount" "" } ] }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // pedido criado com sucesso { "id" 0, "configuration id" 0, "customer profile id" 0, "external id" "", "items" \[ { "id" "", "price" 0, "description" "" } ], "document" "12345678901", "total" 0, "discount" 0, "delivery date" "", "filial" "", "codigofilial" "", "cashback" 0, "status" "created", "two factor" false, "payment methods" \[ { "id" "", "amount" 0 } ], "cashback received" 0, "cashback limit" 0, "created at" "", "updated at" "" }