# Generating a transaction

Endpoint: POST /directbilling/{serviceId}/transactions
Version: 1.0.0
Security: bearerAuth

## Security:

  - `bearerAuth` (unknown)
    http bearer scopes: directbilling.transactions.create

## Path parameters:

  - `serviceId` (string, required)

## Request fields (application/json):

  - `amount` (number, required)
    Transaction amount

  - `amountType` (string)
    Transaction amount type
- `required`
 - a fixed amount that the partner wants to obtain, the final amount to be paid will be visible on the gateway and depends on the operator
- `net`
 - net amount
- `gross`
 - gross amount
    Enum: "required", "net", "gross"

  - `description` (string)
    Transaction description visible on the payment gateway

  - `control` (string)
    Parameter for use by the partner for, e.g. transaction identification

  - `returns` (object)
    URLs to redirect the customer after the transaction

  - `returns.success` (string)
    Address to which the customer should be redirected after a successful transaction

  - `returns.failure` (string)
    Address to which the customer should be redirected after an unsuccessful transaction

  - `phoneNumber` (string)
    Forced phone number

  - `steamid` (string)
    Optional field (steamid64)

## Response 200 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `data` (object, required)

  - `data.transactionId` (string, required)
    Transaction ID

  - `data.redirectUrl` (string, required)

## Response 401:

  - `401` (unknown)
    Unauthorized

## Response 401 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "UNAUTHORIZED"

## Response 403:

  - `403` (unknown)
    Forbidden

## Response 403 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "INVALID_ABILITY_PROVIDED", "IP_ADDRESS_NOT_WHITELISTED"

## Response 404:

  - `404` (unknown)
    NotFound

## Response 404 fields (application/json):

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "SERVICE_NOT_FOUND", "TRANSACTION_NOT_FOUND", "ROUTE_NOT_FOUND"

## Response 422:

  - `422` (unknown)
    Unprocessable Content

## Response 422 fields (application/json):

  - `feedbackUrl` (string)
    URL for reporting API problems (`POST /feedback`). Returned for authenticated API keys.
    Example: https://api.simpay.pl/feedback

  - `success` (boolean, required)
    Request status

  - `errorCode` (string, required)
    Error status code
    Enum: "VALIDATION_ERROR"

  - `errors` (object, required)

  - `errors.amount` (array)

