Buat pembayaran

Buat tautan pembayaran untuk layanan Anda

POST

https://api.fps.pro/invoices/create

Format requestapplication/json

amount

required

number

Jumlah pembayaran dalam fiat yang dipilih

currency

required

string

Fiat yang diterima (lihat daftar fiat)

order_id

string

ID pesanan di sistem Anda

network

string

Anda dapat menentukan jaringan wajib untuk menerima pembayaran, atau membiarkannya kosong untuk menerima pembayaran di jaringan apa pun yang tersedia

webhook_link

url

URL tempat status pembayaran dikirim kembali

Default: merchant settings

success_link

url

URL tujuan pelanggan setelah pembayaran berhasil

Default: merchant settings

error_link

url

URL tujuan pelanggan setelah pembayaran tidak berhasil

Default: merchant settings

part_payment

boolean

Anda dapat mengizinkan atau melarang pembayaran sebagian dalam satu pembayaran

Default: true or merchant settings

ignore_client_amount

boolean

Jika Anda menetapkan True, jumlah apa pun yang dibayar pelanggan akan menyelesaikan invoice dengan sukses

Default: false or merchant settings

payment_accuracy

number

Tentukan nilai persentase dari 1 hingga 100. Jika Anda menetapkan 5 untuk pembayaran $100, maka pembayaran pelanggan sebesar $95 dianggap berhasil

Default: 0 or merchant settings

fee

number

Nilai 1 hingga 100 yang menambahkan biaya persentase ke pembayaran

Default: 0

discount

number

Nilai 1 hingga 100 yang menerapkan diskon persentase ke pembayaran

Default: 0

additional_info

string

Informasi apa pun

auto_convert

boolean

Konversi pembayaran otomatis setelah diterima

Default: false

Format responsdata object

id

uuid

ID invoice

info.currency

string | null

Kode mata uang fiat invoice

info.token

string | null

Token pembayaran

info.network

string | null

Jaringan pembayaran

info.address

string | null

Alamat dompet untuk pembayaran

amount.starting_price

number

Jumlah awal invoice dalam fiat

amount.discount_percent

number

Jumlah diskon dalam persentase

amount.merchant_fee_percent

number

Biaya merchant dalam persentase

amount.service_fee_percent

number | null

Biaya layanan platform dalam persentase

amount.total

number

Jumlah akhir setelah diskon dan biaya

url.webhook

url | null

URL Webhook merchant

url.success

url | null

URL redirect setelah pembayaran berhasil

url.error

url | null

URL redirect setelah pembayaran gagal

url.payment

url

Link halaman pembayaran

options.part_payment

boolean

Apakah pembayaran sebagian diizinkan

options.ignore_client_amount

boolean

Apakah jumlah tepat client diabaikan

options.payment_accuracy

number

Toleransi pembayaran yang diizinkan

additional.order_id

string | null

ID order eksternal

additional.info

string | null

Informasi tambahan order

status

string

Status invoice saat ini

expired_at

string (ISO 8601, UTC)

Tanggal kedaluwarsa invoice

created_at

string (ISO 8601, UTC)

Tanggal pembuatan invoice

Contoh permintaan

curl --request POST 'https://api.fps.pro/invoices/create' \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Id: YOUR_CLIENT_ID' \
  --header 'X-Timestamp: 1720000000' \
  --header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
  --data '{
  "amount": 150.75,
  "currency": "usd",
  "order_id": "ORD-1001",
  "network": "tron",
  "webhook_link": "https://merchant.example.com/webhooks/fps",
  "success_link": "https://merchant.example.com/payments/success",
  "error_link": "https://merchant.example.com/payments/error",
  "part_payment": true,
  "ignore_client_amount": false,
  "payment_accuracy": 0,
  "fee": 1.5,
  "discount": 3,
  "additional_info": "Premium subscription",
  "auto_convert": false
}'

Respons berhasil

{
  "status": 201,
  "message": "invoice created",
  "data": {
    "id": "0a718b02-138d-495a-9661-39ca52139c07",
    "info": {
      "currency": "USD",
      "token": null,
      "network": null,
      "address": null
    },
    "amount": {
      "starting_price": 1000,
      "discount_percent": 0,
      "merchant_fee_percent": 10,
      "service_fee_percent": 1,
      "total": 1100
    },
    "url": {
      "webhook": "https://merchant.example/webhook",
      "success": "https://merchant.example/success",
      "error": "https://merchant.example/error",
      "payment": "https://frontend.example/0a718b02-138d-495a-9661-39ca52139c07"
    },
    "options": {
      "part_payment": true,
      "ignore_client_amount": false,
      "payment_accuracy": 0
    },
    "additional": {
      "order_id": "1",
      "info": ""
    },
    "status": "init",
    "expired_at": "2026-01-05 14:30:43",
    "created_at": "2026-01-05T13:30:43.000Z"
  }
}

Error

Daftar detail error otorisasi ada di Otorisasi - Error

{
  "status": 422,
  "message": "Validation Error",
  "errors": [
    {
      "field": "currency",
      "message": "currency is required"
    }
  ]
}
{
  "status": 500,
  "message": "Internal Server Error"
}