Skip to main content

Create Payment Charge

POST /charges

Description

Create a new payment charge with a specified charge formula.

Body Parameters

NameTypeDescription
tenantIdstringUnique identifier for the tenant (Required)
productTypestringType of product associated with the charge (Required)
paymentMethodstringPayment method associated with the charge (Required)
chargeFormulastringCharge formula for calculating charges (Required)

Charge Formula

The chargeFormula is a string that represents the formula for calculating charges. It can include variables (A for amount, P for percentage), constants (C), operators (* for multiplication, + for addition, - for subtraction), comparators (< for less than, > for greater than), and delimiters (|).

Examples of possible charge formula terms:

  • 5C (constant 5)
  • 4P*A (4 percent of amount)
  • 5.6P*A (5.6 percent of amount)
  • 4P*10C (4 percent multiplied by constant 10)
  • 39C*A (39 times constant multiplied by amount)
  • 20C+A (20 times constant plus amount)
  • 39C-A (39 times constant minus amount)

Example

{
"tenantId": "tenant_id_123",
"productType": "subscription",
"paymentMethod": "credit_card",
"chargeFormula": "2.5.6P*10C"
}

Response Code: 200 - OK

Description

Successful.

Response Field

FieldTypeDescription
statusbooleanIndicates the overall success of the operation.
statusCodeintegerRepresents the specific status code for the response.
messagestringProvides additional information about the response.
dataobjectContains the main data payload of the response.
errorsarrayAn array containing error details if issues occurred.
- messagestringDescribes the error.
- descriptiveMessagestringProvides a more detailed and descriptive message about the error.

Example

<response>
<status>true</status>
<statusCode>0</statusCode>
<message>string</message>
<data></data>
<errors>
<error>
<message>string</message>
<descriptiveMessage>string</descriptiveMessage>
</error>
</errors>
</response>

Method: POST

>http://20.87.230.105/platform/wallets/charges

Headers

Content-TypeValue
apiKey{{apiKey}}

🔑 Authentication bearer

ParamvalueType
token{{accessCode}}string

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request POST \ 
--url /charges \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!