Skip to content

Create a new price

Request

Creates a price governing the referral fee applied to payins, which you then attach to a payin or an order by passing its ID as price_id. The fee it produces is returned as referral_fee on the payment and in a quote's fees breakdown.

Every price created here governs the referral fee — there is no fee type to choose, which is why the Price object carries no fee_type field. GET /prices lists these and only these.

pricing_type selects the shape of the rule and which other fields are permitted — sending a field belonging to the other shape is rejected rather than ignored:

  • fixed requires fees_amount and fees_currency, and must not include bps.

  • percentage requires bps, and must not include fees_amount or fees_currency.

The first referral-fee price you create becomes your default automatically, whether or not you send set_as_default. After that, sending set_as_default: true promotes this price and demotes the previous default — a business has at most one default referral-fee price at a time. The default is what applies when a payin does not name a price_id.

Security
JWT
Bodyapplication/jsonrequired
One of:
pricing_typestringrequired

The type of pricing to be applied.

Value:"fixed"
Example:"fixed"
fees_amountnumber, >= 1required

The amount that will be deducted from your balance for this pricing. A positive integer representing the smallest currency unit. For example, if the amount is $299.00, then pass 29900 in this field. In the case of three decimal currencies, such as KWD, BHD and OMR, to represent an amount of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, for amount ¥295, pass the value as 295

Example:1000
fees_currencystring, (iso-4217)required

The currency code in ISO 4217 format.

Example:"USD"
bpsnumber, >= 1

The percentage fee, in basis points: 1 basis point is 0.01%, so 1000 is 10%. Required when pricing_type is percentage, and must not be sent when it is fixed.

Example:1000
set_as_defaultboolean

Set this pricing as default for the business. Overrides the previously set default if set to true.

Example:true
curl -i -X POST \
  https://api.glomopay.com/api/v1/prices \
  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \
  -H 'Content-Type: application/json' \
  -d '{
    "pricing_type": "fixed",
    "fees_currency": "USD",
    "fees_amount": 1000,
    "bps": 1000,
    "set_as_default": true
  }'

Responses

Payout created successfully

Bodyapplication/json
idstringread-only

The unique identifier for the price. Pass this value as price_id when creating a payin or an order to apply this referral fee to it.

Example:"price_DdWp_HUbOnlg"
pricing_typestring

The type of pricing to be applied.

Enum:"fixed""percentage"
Example:"fixed"
fees_amountnumber, >= 1

The amount that will be deducted from your balance for this pricing. A positive integer representing the smallest currency unit. For example, if the amount is $299.00, then pass 29900 in this field. In the case of three decimal currencies, such as KWD, BHD and OMR, to represent an amount of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, for amount ¥295, pass the value as 295

Example:1000
fees_currencystring, (iso-4217)

The currency code in ISO 4217 format.

Example:"USD"
bpsnumber, >= 1

The percentage fee, in basis points: 1 basis point is 0.01%, so 1000 is 10%. Required when pricing_type is percentage, and must not be sent when it is fixed.

Example:1000
set_as_defaultboolean

Set this pricing as default for the business. Overrides the previously set default if set to true.

Example:true
created_atstring, (date-time)read-only

When the price was created, as an ISO 8601 date-time in UTC.

Example:"2021-06-01T12:00:00Z"
updated_atstring, (date-time)read-only

When the price was last updated, as an ISO 8601 date-time in UTC.

Example:"2021-06-01T12:00:00Z"
Response
{ "id": "price_DdWp_HUbOnlg", "pricing_type": "fixed", "fees_amount": 1000, "fees_currency": "USD", "bps": 1000, "set_as_default": true, "created_at": "2021-06-01T12:00:00Z", "updated_at": "2021-06-01T12:00:00Z" }