API reference
Payment links
Reusable payment pages with QR codes: create, limit, pause and archive them. Details in the guide →
- POST/v1/payment-linksCreate a reusable payment link
- GET/v1/payment-linksList payment links
- GET/v1/payment-links/{id}Get a payment link with stats
- PATCH/v1/payment-links/{id}Update, pause or resume a payment link
/v1/payment-linksCreate a reusable payment link
invoicesKey: live or testRequest body
titlestringrequired1–80 chars
kindstringrequiredValues:
fixedopenprice_usdstringoptionalpattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
min_usdstringoptional· nullablepattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
max_usdstringoptional· nullablepattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
suggested_amountsarray<string>optional≤ 6 items
descriptionstringoptional· nullable≤ 500 chars
tokensarray<string>optionalValues:
TRXUSDT≥ 1 items
success_urlstring (url)optional· nullable≤ 2048 chars
fee_paid_by_customerbooleanoptional· nullableactivebooleanoptionalexpires_atstring (date-time)optional· nullableNo new payment is started after this time; null for no end
pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
max_usesintegeroptional· nullableHow many invoices may be paid or be open in all; null for no limit
1–100000
askobjectoptional· nullableWhat the payer is asked for before paying
namestringValues:
offoptionalrequiredemailstringValues:
offoptionalrequirednotestringValues:
offoptionalrequirednote_labelstring· nullable≤ 40 chars
archivedbooleanoptionalAn archived link takes no payments and is not listed
Responses
- 201 CreatedReturns the PaymentLink object
curl -X POST https://hisarpay.com/v1/payment-links \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"title": "Support us",
"kind": "open",
"min_usd": "10.00",
"suggested_amounts": [
"10.00",
"25.00",
"50.00"
]
}'/v1/payment-linksList payment links
invoicesKey: live or testQuery parameters
activestringoptionalOnly active (true) or paused (false) links.
Values:
truefalsearchivedstringoptionaltrue: the archived ones instead of those in use
Values:
truefalselimitintegeroptionalPage size.
1–100
beforeintegeroptionalnext_before from the previous response, for the next page.
-9007199254740991–9007199254740991
Responses
- 200 OKJSON response
2 fields
dataarray<PaymentLink>next_beforestring | number· nullable
curl "https://hisarpay.com/v1/payment-links?limit=20" \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/payment-links/{id}Get a payment link with stats
invoicesKey: live or testPath parameters
idintegerrequiredThe record id.
-9007199254740991–9007199254740991
Responses
- 200 OKReturns the PaymentLink object
curl https://hisarpay.com/v1/payment-links/42 \
-H "Authorization: Bearer $HISARPAY_API_KEY"/v1/payment-links/{id}Update, pause or resume a payment link
invoicesKey: live or testPath parameters
idintegerrequiredThe record id.
-9007199254740991–9007199254740991
Request body
titlestringoptional1–80 chars
price_usdstringoptionalpattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
min_usdstringoptional· nullablepattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
max_usdstringoptional· nullablepattern ^(0|[1-9]\d{0,11})(\.\d{1,2})?$
suggested_amountsarray<string>optional≤ 6 items
descriptionstringoptional· nullable≤ 500 chars
tokensarray<string>optionalValues:
TRXUSDT≥ 1 items
success_urlstring (url)optional· nullable≤ 2048 chars
fee_paid_by_customerbooleanoptional· nullableactivebooleanoptionalexpires_atstring (date-time)optional· nullableNo new payment is started after this time; null for no end
pattern ^(?:(?:\d\d[2468][048]|\d\d[13579][26]|\d\d0[48]|[02468][048]00|[13579][26]00)-02-29|\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\d|30)|(?:02)-(?:0[1-9]|1\d|2[0-8])))T(?:(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|([+-](?:[01]\d|2[0-3]):[0-5]\d)))$
max_usesintegeroptional· nullableHow many invoices may be paid or be open in all; null for no limit
1–100000
askobjectoptional· nullableWhat the payer is asked for before paying
namestringValues:
offoptionalrequiredemailstringValues:
offoptionalrequirednotestringValues:
offoptionalrequirednote_labelstring· nullable≤ 40 chars
archivedbooleanoptionalAn archived link takes no payments and is not listed
Responses
- 200 OKReturns the PaymentLink object
curl -X PATCH https://hisarpay.com/v1/payment-links/42 \
-H "Authorization: Bearer $HISARPAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"active": false
}'