Skip to main content
POST
/
v1
/
sales
/
{id}
/
payments
Add payment to a sale
curl --request POST \
  --url https://dev.flextell.ai/api/v1/sales/{id}/payments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --header 'X-Tenant: <x-tenant>' \
  --data '
{
  "amount": 1.01,
  "currency_id": 123,
  "exchange_rate": 1,
  "transaction_date": "2023-11-07T05:31:56Z",
  "description": "<string>",
  "account_id": 123
}
'
{
  "success": "<string>",
  "data": {
    "sale_id": "<string>",
    "remaining_balance": "<string>",
    "transaction": {
      "id": "<string>",
      "type": "<string>",
      "credit": "<string>",
      "debit": "<string>",
      "currency_id": "<string>",
      "exchange_rate": "<string>",
      "description": "<string>"
    }
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Headers

X-Tenant
number
required

Tenant identifier. Send the Tenant ID in the X-Tenant header to scope API requests to a specific tenant.

Path Parameters

id
integer
required

The sale identifier

Body

application/json
amount
number
required

Monetary amount.

Required range: x >= 0.01
currency_id
integer | null

Filter by currency ID.

exchange_rate
number | null

Currency exchange rate.

Required range: x >= 0
transaction_date
string<date-time> | null

Transaction date (YYYY-MM-DD).

type
enum<string> | null

Filter by type.

Available options:
collection,
payment
description
string | null

The description.

Maximum string length: 65535
account_id
integer | null

Account ID.

Response

success
string
required
data
object
required