API reference: Payments
The Payments endpoints (4 operations), generated from the OpenAPI document (https://faraatarjomeh.com/api/v1/openapi.json). For task-level walkthroughs use the guides; for error handling use /api/v1/docs/errors. The full reference: /api/v1/docs/reference.
At a glance#
- Auth on every call:
Authorization: Bearer $FARA_API_KEY scope:readfor GET/HEAD,writefor the rest- spends Fara: the call holds or charges Fara; get the price first and send
Idempotency-Key - Path parameters in the examples are shell variables (
$JOB_ID,$ID…) - Errors:
application/problem+jsonwith a stablecode(not repeated per endpoint below)
Index#
- Payments: GET /api/v1/payment/packages, GET /api/v1/payment/packages/public, GET /api/v1/payment/status/{authority}, GET /api/v1/payment/history
Payments#
Fara packages and past payments. Buying happens on the website.
GET /api/v1/payment/packages#
List Fara packages
- operationId
listFaraPackages· scoperead· free
Buying happens on the website; it is not available over the API.
Response 200
Responses
200Packages. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/payment/packages" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/payment/packages/public#
List Fara packages (public copy)
- operationId
listPublicFaraPackages· scoperead· free
Response 200
Responses
200Packages. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/payment/packages/public" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/payment/status/{authority}#
Get the status of a payment
- operationId
getPaymentStatus· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
authority |
path | string | yes | Payment authority code from the payment gateway. |
Response 200
Responses
200Status. (application/json)- Errors:
400,401,403,404,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/payment/status/$AUTHORITY" \
-H "Authorization: Bearer $FARA_API_KEY"GET /api/v1/payment/history#
List payments
- operationId
listPayments· scoperead· free
Parameters
| Name | In | Type | Required | Notes |
|---|---|---|---|---|
page |
query | integer | no | Page number, starting at 1. — default: 1; min 1 |
limit |
query | integer | no | Items per page (1-100). — default: 20; min 1; max 100 |
Response 200
Responses
200One page. (application/json)- Errors:
401,403,429,503— problem+json, see /api/v1/docs/errors
Example
curl -sS -X GET "https://faraatarjomeh.com/api/v1/payment/history" \
-H "Authorization: Bearer $FARA_API_KEY"Schemas#
Named request and response objects used above. Nested objects are flattened as parent.child; arrays as parent[].child.
PaymentHistory#
| Field | Type | Required | Notes |
|---|---|---|---|
payments |
object[] | yes | |
total |
integer | yes | |
page |
integer | yes | |
limit |
integer | no | |
totalPages |
integer | yes |
PaymentPackages#
| Field | Type | Required | Notes |
|---|---|---|---|
vatRate |
number | no | Value added tax added at checkout, as a fraction (0.1 means 10%). |
packages |
object[] | yes | |
packages[].id |
string | no | |
packages[].priceTomans |
number | no | Listed pack price in toman, before value added tax. |
packages[].vatTomans |
number | no | Value added tax on this pack in toman (price × vatRate, rounded to the nearest toman, halves up). |
packages[].totalTomans |
number | no | What you pay on the website: priceTomans + vatTomans. |
packages[].creditFara |
number | no | Fara you get. VAT does not change it. |
packages[].perFara |
number | no | |
packages[].discount |
number | no | |
packages[].shelf |
string | no | |
packages[].description |
string | no | |
gatewayEnabled |
boolean | no | Whether buying is open right now (on the website). |
PaymentStatus#
| Field | Type | Required | Notes |
|---|---|---|---|
authority |
string | no | |
status |
string | no | |
refId |
string | null | no | Bank reference, when completed. — may be null |