Customers
Debit customer wallet
Developer API operation for POST /dev/v1/customers//wallet/debit.
POST
/
dev
/
v1
/
customers
/
{id}
/
wallet
/
debit
Debit customer wallet
curl --request POST \
--url https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "4.50",
"description": "Manual adjustment"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: '4.50', description: 'Manual adjustment'})
};
fetch('https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit"
payload = {
"amount": "4.50",
"description": "Manual adjustment"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit",
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' => '4.50',
'description' => 'Manual adjustment'
]),
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.shoppex.io/dev/v1/customers/{id}/wallet/debit"
payload := strings.NewReader("{\n \"amount\": \"4.50\",\n \"description\": \"Manual adjustment\"\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))
}{
"data": {
"transaction_id": "txn_debit_1",
"amount": 4.5,
"currency": "EUR",
"new_balance": 10.5,
"available_balance": 8,
"wallet_id": "wallet_1"
}
}Previous
Convert affiliate balanceDeveloper API operation for POST /dev/v1/customers/{id}/affiliate/convert-to-balance.
Next
⌘I
Debit customer wallet
curl --request POST \
--url https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "4.50",
"description": "Manual adjustment"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({amount: '4.50', description: 'Manual adjustment'})
};
fetch('https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit"
payload = {
"amount": "4.50",
"description": "Manual adjustment"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.shoppex.io/dev/v1/customers/{id}/wallet/debit",
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' => '4.50',
'description' => 'Manual adjustment'
]),
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.shoppex.io/dev/v1/customers/{id}/wallet/debit"
payload := strings.NewReader("{\n \"amount\": \"4.50\",\n \"description\": \"Manual adjustment\"\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))
}{
"data": {
"transaction_id": "txn_debit_1",
"amount": 4.5,
"currency": "EUR",
"new_balance": 10.5,
"available_balance": 8,
"wallet_id": "wallet_1"
}
}