Withdrawals
Ecart Pay offers for managing withdrawal accounts and tracking withdrawal histories, enabling you to have complete control over your financial processes.
Withdrawals are a fundamental part of business financial management. With Ecart Pay, you can efficiently manage and track your withdrawals by maintaining a list of active withdrawal accounts and generating a detailed transaction history. This ensures that your finances are always in order and readily accessible. Whether you're withdrawing funds to a debit card or transferring to a bank account via CLABE, Ecart Pay provides the tools necessary for streamlined operations.

Image 1. Making a Withdrawal
Active Withdrawal Accounts
Ecart Pay allows you to store and manage multiple withdrawal accounts. These accounts can include debit cards or bank accounts identified by CLABE numbers. By maintaining a list of active withdrawal accounts, you can easily manage where funds are sent.
Endpoint
GET {{baseURL}}/api/accounts/payments/method
Headers
Authorization: {token}
Example Request
curl --location 'https://sandbox.ecartpay.com/api/accounts/payments/method' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
--header 'Cookie: lang=en' \
--data ''
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.ecartpay.com/api/accounts/payments/method"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
req.Header.Add("Cookie", "lang=en")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
GET /api/accounts/payments/method HTTP/1.1
Host: sandbox.ecartpay.com
Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg
Cookie: lang=en
// OkHttp
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://sandbox.ecartpay.com/api/accounts/payments/method")
.method("GET", body)
.addHeader("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
.addHeader("Cookie", "lang=en")
.build();
Response response = client.newCall(request).execute();
// -------------------------------------------------------------
// Unirest
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://sandbox.ecartpay.com/api/accounts/payments/method")
.header("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
.header("Cookie", "lang=en")
.body("")
.asString();
// Fetch
const myHeaders = new Headers();
myHeaders.append("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
myHeaders.append("Cookie", "lang=en");
const raw = "";
const requestOptions = {
method: "GET",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://sandbox.ecartpay.com/api/accounts/payments/method", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
// -------------------------------------------------------------
// jQuery
var settings = {
"url": "https://sandbox.ecartpay.com/api/accounts/payments/method",
"method": "GET",
"timeout": 0,
"headers": {
"Authorization": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
"Cookie": "lang=en"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
// -------------------------------------------------------------
// XHR
// WARNING: For GET requests, body is set to null by browsers.
var data = "";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://sandbox.ecartpay.com/api/accounts/payments/method");
xhr.setRequestHeader("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
// WARNING: Cookies will be stripped away by the browser before sending the request.
xhr.setRequestHeader("Cookie", "lang=en");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_URL, "https://sandbox.ecartpay.com/api/accounts/payments/method");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
headers = curl_slist_append(headers, "Cookie: lang=en");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
curl_slist_free_all(headers);
}
curl_easy_cleanup(curl);
// Axios
const axios = require('axios');
let data = '';
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://sandbox.ecartpay.com/api/accounts/payments/method',
headers: {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
// -------------------------------------------------------------
// Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'sandbox.ecartpay.com',
'path': '/api/accounts/payments/method',
'headers': {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
},
'maxRedirects': 20
};
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();
// -------------------------------------------------------------
// Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://sandbox.ecartpay.com/api/accounts/payments/method',
'headers': {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
// -------------------------------------------------------------
// Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://sandbox.ecartpay.com/api/accounts/payments/method')
.headers({
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
})
.send("")
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sandbox.ecartpay.com/api/accounts/payments/method"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Authorization": @"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
@"Cookie": @"lang=en"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let reqBody =
let uri = Uri.of_string "https://sandbox.ecartpay.com/api/accounts/payments/method" in
let headers = Header.init ()
|> fun h -> Header.add h "Authorization" "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg"
|> fun h -> Header.add h "Cookie" "lang=en"
in
Client.call ~headers `GET uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
// cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sandbox.ecartpay.com/api/accounts/payments/method',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie: lang=en'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
// -------------------------------------------------------------
// Guzzle
<?php
$client = new Client();
$headers = [
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
];
$body = '';
$request = new Request('GET', 'https://sandbox.ecartpay.com/api/accounts/payments/method', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
// -------------------------------------------------------------
// HTTP_Request2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.ecartpay.com/api/accounts/payments/method');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
// -------------------------------------------------------------
// pecl_http
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://sandbox.ecartpay.com/api/accounts/payments/method');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
$headers.Add("Cookie", "lang=en")
$body = @"
"@
$response = Invoke-RestMethod 'https://sandbox.ecartpay.com/api/accounts/payments/method' -Method 'GET' -Headers $headers -Body $body
$response | ConvertTo-Json
# http.client
import http.client
conn = http.client.HTTPSConnection("sandbox.ecartpay.com")
payload = ''
headers = {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
conn.request("GET", "/api/accounts/payments/method", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
// -------------------------------------------------------------
# Requests
import requests
url = "https://sandbox.ecartpay.com/api/accounts/payments/method"
payload = ""
headers = {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
# httr
library(httr)
headers = c(
'Authorization' = 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' = 'lang=en'
)
body = ""
res <- VERB("GET", url = "https://sandbox.ecartpay.com/api/accounts/payments/method", body = body, add_headers(headers))
cat(content(res, 'text'))
// -------------------------------------------------------------
# RCurl
library(RCurl)
headers = c(
"Authorization" = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
"Cookie" = "lang=en"
)
params = ""
res <- getURL("https://sandbox.ecartpay.com/api/accounts/payments/method", .opts=list(httpheader = headers, followlocation = TRUE))
cat(res)
require "uri"
require "net/http"
url = URI("https://sandbox.ecartpay.com/api/accounts/payments/method")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg"
request["Cookie"] = "lang=en"
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg".parse()?);
headers.insert("Cookie", "lang=en".parse()?);
let data = "";
let request = client.request(reqwest::Method::GET, "https://sandbox.ecartpay.com/api/accounts/payments/method")
.headers(headers)
.body(data);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
# Httpie
http --follow --timeout 3600 GET 'https://sandbox.ecartpay.com/api/accounts/payments/method' \
Authorization:'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
Cookie:'lang=en'
// -------------------------------------------------------------
# wget
wget --no-check-certificate --quiet \
--method GET \
--timeout=0 \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
--header 'Cookie: lang=en' \
'https://sandbox.ecartpay.com/api/accounts/payments/method'
var request = URLRequest(url: URL(string: "https://sandbox.ecartpay.com/api/accounts/payments/method")!,timeoutInterval: Double.infinity)
request.addValue("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg", forHTTPHeaderField: "Authorization")
request.addValue("lang=en", forHTTPHeaderField: "Cookie")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
[
{
"id": "602afaafac388c0017e9c3fb",
"method": "debit",
"name": "Principal",
"number": "4242424242424242",
"bank": 40014,
"business_name": "Angel Cantu",
"country": "MX"
},
{
"id": "61e751d7b524d7b950f4d9d4",
"method": "debit",
"name": "Secundaria",
"number": "4242424242424242",
"bank": 40012,
"business_name": "Angel Cantu",
"country": "MX"
},
{
"id": "61e75a32b524d7b950f4d9db",
"method": "clabe",
"name": "FLUDISA-MXP",
"number": "001112125452458751",
"business_name": "Angel Cantu",
"bank": 40072,
"country": "MX",
"currency": "MXN"
}
]

Image 2. Active Withdrawal Accounts
Generating a Withdrawal History
Ecart Pay allows you to generate a detailed withdrawal history, helping you track past transactions and ensuring transparency in financial operations. You can filter the history by date, currency, status, or even specific transaction IDs.
Endpoint
GET {{baseURL}}/api/withdrawals
Headers
Authorization: {token}
Example Request
curl --location 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A' \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
--header 'Cookie: lang=en' \
--data ''
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A"
method := "GET"
payload := strings.NewReader(``)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
req.Header.Add("Cookie", "lang=en")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
GET /api/withdrawals?q=TR00000914A HTTP/1.1
Host: sandbox.ecartpay.com
Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg
Cookie: lang=en
// OkHttp
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
.url("https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A")
.method("GET", body)
.addHeader("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
.addHeader("Cookie", "lang=en")
.build();
Response response = client.newCall(request).execute();
// -------------------------------------------------------------
// Unirest
Unirest.setTimeouts(0, 0);
HttpResponse<String> response = Unirest.get("https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A")
.header("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
.header("Cookie", "lang=en")
.body("")
.asString();
// Fetch
const myHeaders = new Headers();
myHeaders.append("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
myHeaders.append("Cookie", "lang=en");
const raw = "";
const requestOptions = {
method: "GET",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
// -------------------------------------------------------------
// jQuery
var settings = {
"url": "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A",
"method": "GET",
"timeout": 0,
"headers": {
"Authorization": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
"Cookie": "lang=en"
},
};
$.ajax(settings).done(function (response) {
console.log(response);
});
// -------------------------------------------------------------
// XHR
// WARNING: For GET requests, body is set to null by browsers.
var data = "";
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener("readystatechange", function() {
if(this.readyState === 4) {
console.log(this.responseText);
}
});
xhr.open("GET", "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A");
xhr.setRequestHeader("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
// WARNING: Cookies will be stripped away by the browser before sending the request.
xhr.setRequestHeader("Cookie", "lang=en");
xhr.send(data);
CURL *curl;
CURLcode res;
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(curl, CURLOPT_URL, "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A");
curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
curl_easy_setopt(curl, CURLOPT_DEFAULT_PROTOCOL, "https");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg");
headers = curl_slist_append(headers, "Cookie: lang=en");
curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
const char *data = "";
curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);
res = curl_easy_perform(curl);
curl_slist_free_all(headers);
}
curl_easy_cleanup(curl);
// Axios
const axios = require('axios');
let data = '';
let config = {
method: 'get',
maxBodyLength: Infinity,
url: 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A',
headers: {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
// -------------------------------------------------------------
// Native
var https = require('follow-redirects').https;
var fs = require('fs');
var options = {
'method': 'GET',
'hostname': 'sandbox.ecartpay.com',
'path': '/api/withdrawals?q=TR00000914A',
'headers': {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
},
'maxRedirects': 20
};
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();
// -------------------------------------------------------------
// Request
var request = require('request');
var options = {
'method': 'GET',
'url': 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A',
'headers': {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
// -------------------------------------------------------------
// Unirest
var unirest = require('unirest');
var req = unirest('GET', 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A')
.headers({
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
})
.send("")
.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.raw_body);
});
#import <Foundation/Foundation.h>
dispatch_semaphore_t sema = dispatch_semaphore_create(0);
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
NSDictionary *headers = @{
@"Authorization": @"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
@"Cookie": @"lang=en"
};
[request setAllHTTPHeaderFields:headers];
NSData *postData = [[NSData alloc] initWithData:[@"" dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postData];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
dispatch_semaphore_signal(sema);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSError *parseError = nil;
NSDictionary *responseDictionary = [NSJSONSerialization JSONObjectWithData:data options:0 error:&parseError];
NSLog(@"%@",responseDictionary);
dispatch_semaphore_signal(sema);
}
}];
[dataTask resume];
dispatch_semaphore_wait(sema, DISPATCH_TIME_FOREVER);
open Lwt
open Cohttp
open Cohttp_lwt_unix
let reqBody =
let uri = Uri.of_string "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A" in
let headers = Header.init ()
|> fun h -> Header.add h "Authorization" "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg"
|> fun h -> Header.add h "Cookie" "lang=en"
in
Client.call ~headers `GET uri >>= fun (_resp, body) ->
body |> Cohttp_lwt.Body.to_string >|= fun body -> body
let () =
let respBody = Lwt_main.run reqBody in
print_endline (respBody)
// cURL
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie: lang=en'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
// -------------------------------------------------------------
// Guzzle
<?php
$client = new Client();
$headers = [
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
];
$body = '';
$request = new Request('GET', 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A', $headers, $body);
$res = $client->sendAsync($request)->wait();
echo $res->getBody();
// -------------------------------------------------------------
// HTTP_Request2
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
));
$request->setBody('');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
// -------------------------------------------------------------
// pecl_http
<?php
$client = new http\Client;
$request = new http\Client\Request;
$request->setRequestUrl('https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A');
$request->setRequestMethod('GET');
$body = new http\Message\Body;
$request->setBody($body);
$request->setOptions(array());
$request->setHeaders(array(
'Authorization' => 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' => 'lang=en'
));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg")
$headers.Add("Cookie", "lang=en")
$body = @"
"@
$response = Invoke-RestMethod 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A' -Method 'GET' -Headers $headers -Body $body
$response | ConvertTo-Json
# http.client
import http.client
conn = http.client.HTTPSConnection("sandbox.ecartpay.com")
payload = ''
headers = {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
conn.request("GET", "/api/withdrawals?q=TR00000914A", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
// -------------------------------------------------------------
# Requests
import requests
url = "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A"
payload = ""
headers = {
'Authorization': 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie': 'lang=en'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
# httr
library(httr)
headers = c(
'Authorization' = 'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg',
'Cookie' = 'lang=en'
)
body = ""
res <- VERB("GET", url = "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A", body = body, add_headers(headers))
cat(content(res, 'text'))
// -------------------------------------------------------------
# RCurl
library(RCurl)
headers = c(
"Authorization" = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg",
"Cookie" = "lang=en"
)
params = ""
res <- getURL("https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A", .opts=list(httpheader = headers, followlocation = TRUE))
cat(res)
require "uri"
require "net/http"
url = URI("https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A")
https = Net::HTTP.new(url.host, url.port)
https.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg"
request["Cookie"] = "lang=en"
response = https.request(request)
puts response.read_body
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = reqwest::Client::builder()
.build()?;
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("Authorization", "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg".parse()?);
headers.insert("Cookie", "lang=en".parse()?);
let data = "";
let request = client.request(reqwest::Method::GET, "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A")
.headers(headers)
.body(data);
let response = request.send().await?;
let body = response.text().await?;
println!("{}", body);
Ok(())
}
# Httpie
http --follow --timeout 3600 GET 'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A' \
Authorization:'eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
Cookie:'lang=en'
// -------------------------------------------------------------
# wget
wget --no-check-certificate --quiet \
--method GET \
--timeout=0 \
--header 'Authorization: eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg' \
--header 'Cookie: lang=en' \
'https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A'
var request = URLRequest(url: URL(string: "https://sandbox.ecartpay.com/api/withdrawals?q=TR00000914A")!,timeoutInterval: Double.infinity)
request.addValue("eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3MmE4NTAzNzFiZTBlY2Y1NTRkMDUxNiIsImFjY291bnRfaWQiOiI2NzJhODUwMzcxYmUwZWNmNTU0ZDA1MGMiLCJpYXQiOjE3Mzg4NjAzODEsImV4cCI6MTczODg2Mzk4MX0.B5UPY98gAlnaN09c6tGQyRwjKi-j0vEUYeyw-FibcisvVzi3YTW7l-OwmBKi8MSYxTh937AktV03UqBuCXlAPg", forHTTPHeaderField: "Authorization")
request.addValue("lang=en", forHTTPHeaderField: "Cookie")
request.httpMethod = "GET"
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
{
"count": 1,
"docs": [
{
"id": "654bdf28a5aaf0231c7fe800",
"account_id": "5fab3b20b40b0a613e1b6f15",
"withdrawal_id": "654bdf28a5aaf0231c7fe7fa",
"payment_method_id": "60e634800baa1c00156fb9b2",
"transaction_id": "TR00000914A",
"type": "charge",
"status": "processing",
"amount": 100,
"fee": 0,
"previous": -144059.69,
"current": -144159.69,
"currency": "MXN",
"gateway": "stp",
"exchange": 1,
"reference_id": "654bdf28a5aaf0231c7fe7f8",
"reference": "654bdf28a5aaf0231c7fe7f8",
"reason": "bank transfer",
"custom_keys": false,
"charges": [],
"created_at": "2023-11-08T19:19:04.539Z",
"updated_at": "2023-11-08T19:19:04.539Z",
"in_review": true,
"in_review_at": "2024-03-22T21:05:41.131Z",
"account": {
"id": "5fab3b20b40b0a613e1b6f15",
"number": "0000000001",
"email": "[email protected]",
"first_name": "Alex",
"last_name": "de la Cruz",
"phone": "528114854357"
},
"payment_method": {}
}
],
"pages": 1
}
Managing withdrawals through Ecart Pay simplifies financial transactions, offering an organized and transparent system for your business. By maintaining a list of active withdrawal accounts and leveraging the detailed transaction history, you gain complete control and visibility over your funds. This ensures your business runs smoothly, while keeping your financial operations secure and efficient.
Updated about 2 months ago