Customer

Customer ListGet

https://sandbox-api.srpago.com/v1/customer
Lista los customer’s asociados a una cuenta.

headers

AuthorizationBasic

Content-Typeapplication/json


Example Request

  curl --location --request GET "https://sandbox-api.srpago.com/v1/customer" \
  --header "Content-Type: application/json"
  --header "Authorization: Basic "
var settings = {
  "url": "https://sandbox-api.srpago.com/v1/customer",
  "method": "GET",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Basic "
  },
};
$.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::Get.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Basic "

response = http.request(request)
puts response.read_body
import requests
url = 'https://sandbox-api.srpago.com/v1/customer/cus_rb98a47da-a06b-11e6-902b-b9ef84c85b71'
payload = {}
headers = {
  'Content-Type': 'application/json',
  'Authorization': 'Basic '
}
response = requests.request('GET', url, headers = headers, data = payload, allow_redirects=False, timeout=undefined, allow_redirects=false)
print(response.text)
var https = require('https');

var options = {
  'method': 'GET',
  'hostname': 'https://sandbox-api.srpago.com',
  'path': '/v1/customer/cus_rb98a47da-a06b-11e6-902b-b9ef84c85b71',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Basic '
  }
};

var req = https.request(options, function (res) {
  var chunks = [];

  res.on("data", function (chunk) {
    chunks.push(chunk);
  });

  res.on("end", function (chunk) {
    var body = Buffer.concat(chunks);
    console.log(body.toString());
  });

  res.on("error", function (error) {
    console.error(error);
  });
});

req.end();
$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "https://sandbox-api.srpago.com/v1/customer/cus_rb98a47da-a06b-11e6-902b-b9ef84c85b71",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => false,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "GET",
  CURLOPT_HTTPHEADER => array(
    "Content-Type: application/json"
     "Authorization: Basic fZGV2XzVlNDViNmU5MjY3NjI2MTQ5MmNiNjIyNDU0ZTJmYWQwODpmVGdPM1JpZ3Y0WHM"
  ),
));

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
  "fmt"
  "os"
  "path/filepath"
  "net/http"
  "io/ioutil"
)

func main() {

  url := "https://sandbox-api.srpago.com/v1/customer/cus_rb98a47da-a06b-11e6-902b-b9ef84c85b71"
  method := "GET"

  client := &http.Client {
    CheckRedirect: func(req *http.Request, via []*http.Request) error {
      return http.ErrUseLastResponse
    },
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
  }
  req.Header.Add("Content-Type", "application/json")

  res, err := client.Do(req)
  defer res.Body.Close()
  body, err := ioutil.ReadAll(res.Body)

  fmt.Println(string(body))
}

Example Response

{
  "success": true,
  "result": {
    "id": "cus_rb98a47da-a06b-11e6-902b-b9ef84c85b71",
    "name": "CUSTOMER NAME",
    "email": "[email protected]",
    "active": true,
    "date_create": "2016-10-08T01:29:57-05:00",
    "sources": [
      {
        "id": "spe_5a502b421852e",
        "type": "spei",
        "name": "clabe_nombre",
        "clabe": "646320125500000105",
        "reference": "",
        "bank_name": "STP"
      }
    ],
    "cards": [
      {
        "token": "crd_4030d0ef71c4668c6a6da41a897dd305717f7901",
        "holder_name": "CUSTOMER FULL NAME",
        "type": "VISA",
        "number": "441104XXXXXX000000",
        "expiration": "1807",
        "country_code": "MX",
        "bank_name": "JPMORGAN CHASE BANK N.A.",
        "funding": "DEBIT"
      }
    ],
    "deactivated_cards": 0
  }
}