Customer
Customer CreatePost
https://sandbox-api.srpago.com/v1/customer
Create a new customer
headers
AuthorizationBasic
Content-Typeapplication/json
body
{"name":"here the name2","email":"[email protected]","metadata":{"algo":"value"}}
Example Request
curl --location --request POST "https://sandbox-api.srpago.com/v1/customer" \ --header "Content-Type: application/json" \ --header "Authorization: Basic" \ --data "{\"name\":\"here the name2\",\"email\":\"[email protected]\",\"metadata\":{\"algo\":\"value\"}}"
var settings = {
"url": "https://sandbox-api.srpago.com/v1/customer",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/json"
},
"data": "{\"name\":\"here the name2\",\"email\":\"[email protected]\",\"metadata\":{\"algo\":\"value\"}}",
};
$.ajax(settings).done(function (response) {
console.log(response);
});
require "uri"
require "net/http"
url = URI("https://sandbox-api.srpago.com/v1/customer")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic "
request.body = "{\"name\":\"here the name2\",\"email\":\"[email protected]\",\"metadata\":{\"algo\":\"value\"}}"
response = http.request(request)
puts response.read_body
import requests
url = 'https://sandbox-api.srpago.com/v1/customer'
payload = "{\"name\":\"here the name2\",\"email\":\"[email protected]\",\"metadata\":{\"algo\":\"value\"}}"
headers = {
'Content-Type': 'application/json',
'Authorization': 'Basic '
}
response = requests.request('POST', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false)
print(response.text)
var https = require('https');
var options = {
'method': 'POST',
'hostname': 'https://sandbox-api.srpago.com',
'path': '/v1/customer',
'headers': {
'Content-Type': 'application/json',
'Authorization': 'Basic
package main
import (
"fmt"
"strings"
"os"
"path/filepath"
"net/http"
"io/ioutil"
)
func main() {
url := "https://sandbox-api.srpago.com/v1/customer"
method := "POST"
payload := strings.NewReader("{\"name\":\"here the name2\",\"email\":\"[email protected]\",\"metadata\":{\"algo\":\"value\"}}")
client := &http.Client {
CheckRedirect: func(req *http.Request, via []*http.Request) error {
return http.ErrUseLastResponse
},
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
}
req.Header.Add("Content-Type", "application/json")
req.Header.Add("Authorization", "Basic ")
res, err := client.Do(req)
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
fmt.Println(string(body))
}