Create seller payout charge
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_number": "<string>",
"seller_id": "<string>",
"charge_fixed_amount": 0,
"charge_percent": 0,
"remarks": "",
"tax_rate": 123
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges"
payload = {
"invoice_number": "<string>",
"seller_id": "<string>",
"charge_fixed_amount": 0,
"charge_percent": 0,
"remarks": "",
"tax_rate": 123
}
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({
invoice_number: '<string>',
seller_id: '<string>',
charge_fixed_amount: 0,
charge_percent: 0,
remarks: '',
tax_rate: 123
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges",
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([
'invoice_number' => '<string>',
'seller_id' => '<string>',
'charge_fixed_amount' => 0,
'charge_percent' => 0,
'remarks' => '',
'tax_rate' => 123
]),
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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges"
payload := strings.NewReader("{\n \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges")
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 \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"payout_charge": {
"base_amount": 123,
"charge_amount": 123,
"charge_basis": "percent",
"charge_fixed_amount": 123,
"charge_percent": 123,
"charge_type": "commission",
"created_at": "2023-11-07T05:31:56Z",
"invoice_number": "<string>",
"modified_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"tax_amount": 123,
"tax_rate": 123
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {
"fieldname": [
"<string>"
]
}
}{
"message": "Not authorized for given operation on the Resource.",
"success": false,
"code": "unauthorized"
}Payouts
Create seller payout charge
Create an admin-applied charge against a pending seller payout invoice.
POST
/
orders
/
payouts
/
invoices
/
charges
Create seller payout charge
curl --request POST \
--url https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"invoice_number": "<string>",
"seller_id": "<string>",
"charge_fixed_amount": 0,
"charge_percent": 0,
"remarks": "",
"tax_rate": 123
}
'import requests
url = "https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges"
payload = {
"invoice_number": "<string>",
"seller_id": "<string>",
"charge_fixed_amount": 0,
"charge_percent": 0,
"remarks": "",
"tax_rate": 123
}
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({
invoice_number: '<string>',
seller_id: '<string>',
charge_fixed_amount: 0,
charge_percent: 0,
remarks: '',
tax_rate: 123
})
};
fetch('https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges', 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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges",
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([
'invoice_number' => '<string>',
'seller_id' => '<string>',
'charge_fixed_amount' => 0,
'charge_percent' => 0,
'remarks' => '',
'tax_rate' => 123
]),
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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges"
payload := strings.NewReader("{\n \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\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://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://staging.api.commercengine.io/api/v1/{store_id}/admin/orders/payouts/invoices/charges")
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 \"invoice_number\": \"<string>\",\n \"seller_id\": \"<string>\",\n \"charge_fixed_amount\": 0,\n \"charge_percent\": 0,\n \"remarks\": \"\",\n \"tax_rate\": 123\n}"
response = http.request(request)
puts response.read_body{
"message": "<string>",
"success": true,
"content": {
"payout_charge": {
"base_amount": 123,
"charge_amount": 123,
"charge_basis": "percent",
"charge_fixed_amount": 123,
"charge_percent": 123,
"charge_type": "commission",
"created_at": "2023-11-07T05:31:56Z",
"invoice_number": "<string>",
"modified_at": "2023-11-07T05:31:56Z",
"remarks": "<string>",
"tax_amount": 123,
"tax_rate": 123
}
}
}{
"message": "<string>",
"success": true,
"code": "<string>",
"error": {
"fieldname": [
"<string>"
]
}
}{
"message": "Not authorized for given operation on the Resource.",
"success": false,
"code": "unauthorized"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Available options:
percent, fixed, percent_plus_fixed Available options:
commission, other Pending payout invoice number in the current store.
Seller ID must exist in the marketplace seller cache and match the payout invoice.
Required to be greater than 0 when charge_basis is fixed or percent_plus_fixed.
Required to be greater than 0 when charge_basis is percent or percent_plus_fixed.
Was this page helpful?
⌘I