# Create a new price

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`.

Endpoint: POST /prices
Version: 1.0.0
Security: JWT

## Security:

  - `JWT` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `pricing_type` (string)
    The type of pricing to be applied.
    Enum: "fixed", "percentage"

  - `fees_amount` (number)
    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_currency` (string)
    The currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
    Example: USD

  - `bps` (number)
    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_default` (boolean)
    Set this pricing as default for the business. Overrides the previously set default if set to `true`.
    Example: true

  - `pricing_type` (string, required)
    Enum: "fixed"

  - `fees_currency` (string, required)

  - `fees_amount` (number, required)

  - `pricing_type` (string, required)
    Enum: "percentage"

  - `bps` (number, required)

## Response 201:

  - `201` (unknown)
    Payout created successfully

## Response 201 fields (application/json):

  - `id` (string)
    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_type` (string)
    The type of pricing to be applied.
    Enum: "fixed", "percentage"

  - `fees_amount` (number)
    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_currency` (string)
    The currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format.
    Example: USD

  - `bps` (number)
    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_default` (boolean)
    Set this pricing as default for the business. Overrides the previously set default if set to `true`.
    Example: true

  - `created_at` (string)
    When the price was created, as an ISO 8601 date-time in UTC.
    Example: 2021-06-01T12:00:00Z

  - `updated_at` (string)
    When the price was last updated, as an ISO 8601 date-time in UTC.
    Example: 2021-06-01T12:00:00Z

## Response 400:

  - `400` (unknown)
    Bad Request

