API Docs
Clientes
/customers
1 min
code examples curl location '/customers' \\ \ header 'accept application/json' \\ \ header 'content type application/json' \\ \ data '{ "document" "12345678901" }'var myheaders = new headers(); myheaders append("accept", "application/json"); myheaders append("content type", "application/json"); var raw = json stringify({ "document" "12345678901" }); var requestoptions = { method 'post', headers myheaders, body raw, redirect 'follow' }; fetch("/customers", 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("/customers") 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({ "document" "12345678901" }) response = http request(request) puts response read body import requests import json url = "/customers" payload = json dumps({ "document" "12345678901" }) headers = { 'accept' 'application/json', 'content type' 'application/json' } response = requests request("post", url, headers=headers, data=payload) print(response text) responses // cliente criado com sucesso { "id" 0, "customer id" 0, "account id" 0, "email" "", "cellphone" "5511999999999", "created at" "", "updated at" "", "customer" { "id" 0, "name" "", "document" "12345678901", "birthdate" "", "created at" "", "updated at" "" } }