curl --request POST \
--url https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency_code": "<string>",
"register_payment_method_id": "<string>",
"reference": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals"
payload = {
"amount": 123,
"currency_code": "<string>",
"register_payment_method_id": "<string>",
"reference": "<string>",
"reason": "<string>"
}
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: 123,
currency_code: '<string>',
register_payment_method_id: '<string>',
reference: '<string>',
reason: '<string>'
})
};
fetch('https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals', 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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals",
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' => 123,
'currency_code' => '<string>',
'register_payment_method_id' => '<string>',
'reference' => '<string>',
'reason' => '<string>'
]),
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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals")
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\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customer_id": "<string>",
"type": "<string>",
"direction": "<string>",
"nature": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_exponent": 123,
"reference": "<string>",
"source_activity_type": "<string>",
"source_activity_id": "<string>",
"register_payment_method_id": "<string>",
"payment_method": "<string>",
"cashier_id": "<string>",
"cash_register_id": "<string>",
"cash_account_id": "<string>",
"reason": "<string>",
"created_by": "<string>",
"created_at": "<string>"
}{
"message": "<string>",
"errors": {}
}Pay a customer's store credit out in cash
Gives a customer cash from their refundable credit, from the open register of the cashier making the call.
curl --request POST \
--url https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": 123,
"currency_code": "<string>",
"register_payment_method_id": "<string>",
"reference": "<string>",
"reason": "<string>"
}
'import requests
url = "https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals"
payload = {
"amount": 123,
"currency_code": "<string>",
"register_payment_method_id": "<string>",
"reference": "<string>",
"reason": "<string>"
}
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: 123,
currency_code: '<string>',
register_payment_method_id: '<string>',
reference: '<string>',
reason: '<string>'
})
};
fetch('https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals', 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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals",
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' => 123,
'currency_code' => '<string>',
'register_payment_method_id' => '<string>',
'reference' => '<string>',
'reason' => '<string>'
]),
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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\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.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.exowpee.com/v1/customer/customers/{customer}/store-credit/withdrawals")
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\": 123,\n \"currency_code\": \"<string>\",\n \"register_payment_method_id\": \"<string>\",\n \"reference\": \"<string>\",\n \"reason\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"customer_id": "<string>",
"type": "<string>",
"direction": "<string>",
"nature": "<string>",
"amount": 123,
"currency_code": "<string>",
"currency_exponent": 123,
"reference": "<string>",
"source_activity_type": "<string>",
"source_activity_id": "<string>",
"register_payment_method_id": "<string>",
"payment_method": "<string>",
"cashier_id": "<string>",
"cash_register_id": "<string>",
"cash_account_id": "<string>",
"reason": "<string>",
"created_by": "<string>",
"created_at": "<string>"
}{
"message": "<string>",
"errors": {}
}customers.withdrawcredit
Conditions
- the call must come from a cashier whose register is open; the cash comes out of that register
- the customer must hold store credit in the currency asked for
- the register payment method must be one of that register, accept outgoing money and be cash; other methods are refused
- the cash account of the register must be set up
- the amount must be above 0, with no more decimals than the wallet currency, and cannot exceed the refundable credit of the customer in that currency
- the reference is required and must be unique among the company’s store credit movements
- the refundable credit of the customer goes down by the amount
- the cash refund is posted in the accounts, out of the register cash account, and the movement records the register, the cashier, the payment method and the cash account
- a withdrawal movement is added to the customer’s history
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Identifier of the customer (27-character KSUID string).
Query Parameters
Response mode. Default none; none answers 204 No Content.
none, resource Comma-separated JSON keys of the root resource (id is always rendered). Available: id, customer_id, type, direction, nature, amount, currency_code, currency_exponent, reference, source_activity_type, source_activity_id, register_payment_method_id, payment_method, cashier_id, cash_register_id, cash_account_id, reason, created_by, created_at.
Comma-separated include paths, each optionally followed by its fields in parentheses: units(id,sku),units.uomUnit(id,name). Max depth 6, max 40 paths. Available: .
Body
Amount to pay out, in main units of the currency (for example 12500 for 12,500 FCFA), above 0 and with no more decimals than the wallet currency.
Currency of the wallet to take the credit from. It must be one of the company's currencies and the customer must hold a wallet in it.
3Payment method of the cashier's open register that pays the cash out. It must accept outgoing money and be cash.
27Your reference for this payout, up to 100 characters, unique among the company's store credit movements.
100Why the credit is paid out, up to 255 characters. Optional.
255Response
Resource (only with response=resource).
Identifier of the movement.
Customer whose wallet moved.
What happened: issue (credit added, for example by a cancelled paid sale), withdrawal (cash paid out to the customer), redemption (credit used) or reversal (a movement undone). Only issues and withdrawals are recorded today.
credit when the wallet gained money, debit when it lost money.
Which half of the wallet moved: advance (money paid in advance) or refundable (credit that can be paid back in cash).
Amount of the movement, in main units of currency_code. Always positive; direction tells the sign.
Currency of the movement.
Number of decimal places of the currency for this movement.
Reference given with the withdrawal, unique among the company's movements. Empty for credit added by a cancelled sale.
Kind of document that caused the credit, for example order. Empty for withdrawals.
Identifier of that document, for example the cancelled order.
Register payment method the cash went out through. Withdrawals only.
Payment method the cash went out through. Withdrawals only, always cash.
Cashier who paid the cash out. Withdrawals only.
Register the cash came from. Withdrawals only.
Cash account the money left. Withdrawals only.
Free-text reason given with the withdrawal.
Agent account or user profile that caused the movement.
When the movement was recorded.