To receive funds from your customer, you must first create a payment. Payment is initially created with an unpaid status and a payment request that can be converted into a QR code. Your customer can pay the funds by scanning this QR code. When any amount of funds is transferred by the customer, the status of the payment changes to paid. Even if the payment made is partial, the status will change to paid. The payment object is marked expired when the timeframe (ttl) expires.
Make sure you create and manage new payments upon receival of partial payment if you still want to collect further payment.
{
"id": "pi_xxxxxxxxxxxxxx",
"object": "payment",
"status": "paid",
"currency": "USD",
"amount": 10,
"exchange_rate": 100,
"target_currency": "SATS",
"target_amount": 1000,
"target_amount_paid": 500,
"target_amount_paid_at": 1654589184708,
"target_amount_paid_by": "onchain_xxxxxxxxx",
"confirmations": 1,
"payment_methods": [
"onchain",
"lightning"
],
"payment_method_options": {
"onchain": {
"id": "onchain_xxxxxxxxxxxxx",
"address": null
},
"lightning": {
"id": "ln_xxxxx",
"payment_request": null
},
"ttl": 600,
"expires_at": 1654589184908,
"description": null,
"statement_descriptor": null,
"onchain_tx_explorer_link": "https://mempool.space/xxxxxxxxxxxxxxxxxxxxx",
"created": 1654588584908,
"modified": 1654588584908
}
}
Attributes
id string
Unique identifier for the object.
object string
The type of the object indicates to which entity this response belongs.
status string
A payment object can have 4 statuses as mentioned below.
unpaid
The payment object has unpaid status after its generation until it is paid or expired.
paid
The payment object is marked paid once any amount of payment is received within the timeframe (ttl).
expired
If the payment is not paid within the stipulated timeframe (ttl) then it will be marked as expired.
cancelled
When you deactivate a checkout or payment link, the payment associated with it gets cancelled.
currency string
The base currency in which you prefer to work.
amount BigDecimal
Total amount for which the payment was created. Values up to 32 digits can be handled by the amount param, which can have a decimal precision up to 16 digits.
exchange_rate BigDecimal
The exchange rate is used to convert the currency(base currency) into target_currency.
target_currency string
The cryptocurrency in which you want to receive payment from your customer. As of now, Speed only supports SATS and BTC.
target_amount BigDecimal
The converted amount (from base currency to target_currency) for which the payment request is generated.
target_amount_paid BigDecimal
Once the payment is made, this returns the exact amount received in the target_currency.
target_amount_paid_at timestamp
Time at which the payment was paid.
target_amount_paid_by string
This parameter specifies the id of the payment method through which this payment was made.
confirmations integer
This parameter specifies the number of confirmations received for the on-chain payment.
payment_methods enum
Both on-chain and lightning network methods can be used to receive funds. Please indicate whether you want to use lightning or on-chain. If you do not specify, then a lightning network payment is generated.
payment_method_options object
This object contains two objects, lightning, and on-chain, both specifying all the data required to process the payment.
on_chain object
This object has all the data associated with the payment if the payment method is on-chain.
id string
Unique identifier for the on-chain object.
address string
It specifies the BTC wallet address to which the payment is processed.
lightning object
This object has all the data associated with the payment if the payment method is lightning.
id string
Unique identifier for the lightning object.
payment_request string
The lightning network payload for generating a QR code is returned.
ttl integer
Represents the time duration until which the payment has not expired. (Specified in milliseconds)
onchain_tx_explorer_link string
Once the payment is made you can check the payment details on this mempool link.
expires_at timestamp
Time at which the payment expires.
description string
Additional information about this payment.
statement_descriptor string
Additional information about a payment made to an account. Default is “ Payment from <account_name> “ if you don’t pass any value.
created timestamp
Time at which the payment object was created.
modified timestamp
Time at which the last modification was made.