Prepare Amount endpoint

This endpoint takes an amount in piasters, calculates the service fees and returns the total amount.

Note: depending on the agreement with XPay, if your community's service fees are included in bill, you do not need to use this endpoint. skip to next step

REQUEST

Testing server:

POST https://staging.xpay.app/api/v1/payments/prepare-amount/

Production(Live) server:

POST https://community.xpay.app/api/v1/payments/prepare-amount/

Parameters

Do not supply any parameters.

Request body

Required Properties

Property nameValueDescriptionNotes
community_idstringID that is uniques to your community
amountfloatamount that represents the service cost without service fees

Optional Properties

Property nameValueDescriptionNotes
currencystringamount currencysupported currencies are "EGP", "USD", "EUR", "SAR", "AED", "GBP" and The default currency is EGP and all fees are calculated based on this currency.
selected_payment_methodstringthe used payment method "card, fawry, ... etc"The default payment method is card and all fees are calculated based on this method.

Response

If successful, this method returns a response body with the following structure:

{
    "status": {
        "code": integer,
        "message": string,
        "errors": []
    },

    "data": {
        "total_amount": float
        "total_amount_currency": string
    },
    "count": integer,
    "next": string,
    "previous": string
}
Property nameValueDescriptionNotes
total_amountfloatservice cost with service fees includedsave the value returned in <total_amount> as you will use it later.
total_amount_currencystringcurrency

Example

{
  "amount": 50,
  "community_id": "zogDmQW",
  "currency": "EGP", // optional: default is "EGP"
  "selected_payment_method": "card" // optional: default is "card"
}