Card to wallet transfer
curl --request POST \
--url https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 2000,
"card_reference": "6516484d-0059-4f53-b2cf-31f3ae884d3a",
"reference": "b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i",
"phone": "XXXXXXXXX",
"network": "XXXXXXX"
}
'import requests
url = "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet"
payload = {
"amount": 2000,
"card_reference": "6516484d-0059-4f53-b2cf-31f3ae884d3a",
"reference": "b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i",
"phone": "XXXXXXXXX",
"network": "XXXXXXX"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 2000,
card_reference: '6516484d-0059-4f53-b2cf-31f3ae884d3a',
reference: 'b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i',
phone: 'XXXXXXXXX',
network: 'XXXXXXX'
})
};
fetch('https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2000,
'card_reference' => '6516484d-0059-4f53-b2cf-31f3ae884d3a',
'reference' => 'b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i',
'phone' => 'XXXXXXXXX',
'network' => 'XXXXXXX'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet"
payload := strings.NewReader("{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}"
response = http.request(request)
puts response.read_body{
"message": "OK",
"statusCode": 200,
"data": {
"transaction": {
"slug": "e1d30877-0353-45b3-82fb-92780238ecb4",
"card_reference": "9c54515e-7890-44f9-8cc2-a85b80322b98",
"reference": "b60f55b1-922a-406a-8417-g54atb0849ttb22c",
"status": "pending",
"kind": "card_to_wallet",
"merchant": false,
"amount": 2000,
"phone": "XXXXXXXX",
"network": "XXXXXXXX",
"created_at": "2023-06-22T10:40:17.000000Z"
}
}
}{
"message": "Bad Request",
"statusCode": 400,
"errors": {
"reference": [
"La valeur du champ reference est déjà utilisée."
]
}
}Transactions
Card to wallet transfer
POST
/
transactions
/
create
/
card-to-wallet
Card to wallet transfer
curl --request POST \
--url https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 2000,
"card_reference": "6516484d-0059-4f53-b2cf-31f3ae884d3a",
"reference": "b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i",
"phone": "XXXXXXXXX",
"network": "XXXXXXX"
}
'import requests
url = "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet"
payload = {
"amount": 2000,
"card_reference": "6516484d-0059-4f53-b2cf-31f3ae884d3a",
"reference": "b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i",
"phone": "XXXXXXXXX",
"network": "XXXXXXX"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 2000,
card_reference: '6516484d-0059-4f53-b2cf-31f3ae884d3a',
reference: 'b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i',
phone: 'XXXXXXXXX',
network: 'XXXXXXX'
})
};
fetch('https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 2000,
'card_reference' => '6516484d-0059-4f53-b2cf-31f3ae884d3a',
'reference' => 'b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i',
'phone' => 'XXXXXXXXX',
'network' => 'XXXXXXX'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet"
payload := strings.NewReader("{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.saalal.com/v1/transactions/create/card-to-wallet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 2000,\n \"card_reference\": \"6516484d-0059-4f53-b2cf-31f3ae884d3a\",\n \"reference\": \"b60f54d5b1-922a-40ty6a-8417-fasjhdfdfdi231i\",\n \"phone\": \"XXXXXXXXX\",\n \"network\": \"XXXXXXX\"\n}"
response = http.request(request)
puts response.read_body{
"message": "OK",
"statusCode": 200,
"data": {
"transaction": {
"slug": "e1d30877-0353-45b3-82fb-92780238ecb4",
"card_reference": "9c54515e-7890-44f9-8cc2-a85b80322b98",
"reference": "b60f55b1-922a-406a-8417-g54atb0849ttb22c",
"status": "pending",
"kind": "card_to_wallet",
"merchant": false,
"amount": 2000,
"phone": "XXXXXXXX",
"network": "XXXXXXXX",
"created_at": "2023-06-22T10:40:17.000000Z"
}
}
}{
"message": "Bad Request",
"statusCode": 400,
"errors": {
"reference": [
"La valeur du champ reference est déjà utilisée."
]
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Body
application/json
⌘I
