Payment links and email
Create a link for a reservation, rental or invoice, email it to the customer and track the payment.
Use a QuoSuite qss_… key from Settings › API & Integrations and send it as Authorization: Bearer <key>. Grant payment_links:write to issue links and emails:write to send email. Grant payment_links:read for a key that only needs to read or email an existing link. Both resources require explicit scopes. Payment links and payment email templates require Online Payments (PAYMENT_GATEWAYS). Rental link creation also requires Car Rental. Enable a payment gateway that accepts the link’s currency before sharing it.
Create a payment link
Send one POST /payment-links. For a rental link, use the ERP reservation id from GET /car-rental/reservations or the rental contract id from GET /car-rental/contracts. If you start from an online booking, use its reservationId as the targetId.
Reservations can receive new links while PENDING or CONFIRMED. Once a reservation becomes a rental agreement, use the agreement ID. A cancelled agreement cannot receive a new link.
type | targetId | Amount modes |
|---|---|---|
RESERVATION | ERP reservation UUID | FIXED, PERCENTAGE, REMAINING, FULL |
RENTAL | ERP rental contract UUID | FIXED, PERCENTAGE, REMAINING, FULL |
INVOICE | Sales invoice UUID | FIXED, REMAINING |
STANDALONE | Omit | FIXED |
FIXEDusesamountin the currency’s main unit. For example,150.500means 150 dinars and 500 millimes in TND.PERCENTAGEusespercentagebetween0.0001and100of the total including tax. QuoSuite rounds to the rental currency’s precision and rejects an amount greater than the outstanding balance.REMAININGuses the outstanding balance.FULLuses the total including tax and is accepted only if that amount is still due.- Omit
amountModeto infer it fromamountorpercentage. Without either field, QuoSuite usesREMAINING. Supply one amount field at most. - A linked payment inherits its currency. A standalone link can specify
currencyCodeor use the workspace default. Setlabelto customize what the payer sees andexpiresInDaysto set the lifetime. Omit it or pass0for a link without an expiry.
This example requests a 30% deposit on an existing reservation.
export QUOSUITE_BASE="https://quosuite.com/api/public/v1/quosuite"
export QUOSUITE_API_KEY="qss_…"
curl --fail-with-body "$QUOSUITE_BASE/payment-links" \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 5be12666-1b0a-4c6a-8db5-312213ad808c' \
-d '{"type":"RESERVATION","targetId":"5df9bd02-dc5a-4b13-8ee6-341d7a33a842","percentage":30,"expiresInDays":7}'For a fixed amount on a rental, send this body with a new idempotency key.
{"type":"RENTAL","targetId":"46deadd4-03dc-4496-b34c-827a05ce65bf","amount":150}The 201 response contains data.id and data.url. Keep the ID for follow-up calls and share the URL with the payer. The hosted page shows the supported card, wallet or bank-transfer methods configured for that currency and handles redirects, payment updates and proof uploads. The customer needs only the URL.
Email the link or send a reminder
Use the returned payment link UUID. The first email and each intentional reminder use different Idempotency-Key values. Retry the same send with its original key and body.
export LINK_ID="<data.id from POST /payment-links>"
curl --fail-with-body "$QUOSUITE_BASE/emails" \
-H "Authorization: Bearer $QUOSUITE_API_KEY" \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 4acab944-2077-4704-aab4-6eb4626f16d3' \
-d "{\"template\":\"PAYMENT_LINK\",\"paymentLinkId\":\"$LINK_ID\",\"locale\":\"en\"}"template | Body and recipient |
|---|---|
PAYMENT_LINK | Provide paymentLinkId. QuoSuite sends to the billed customer’s address for a linked payment. Include to for a standalone link. |
PAYMENT_REMINDER | Uses the same fields and recipient. QuoSuite sends the reminder when you call the endpoint. |
CUSTOM | Provide one to email address, a single-line subject and a plain-text body. QuoSuite renders the body in the workspace’s branded layout. |
The built-in templates are listed at GET /emails/templates. locale accepts en, fr or ar and defaults to the workspace language. Payment templates require an active link, a compatible payment method and a valid recipient. A linked payment must still match the current billed customer and outstanding balance.
{"template":"CUSTOM","to":"customer@example.com","subject":"Rental pickup reminder","body":"Your vehicle is ready for pickup tomorrow at 10:00.\nPlease bring your driving licence.","locale":"en"}POST /emails returns 202 and an email ID in data.id. Use GET /emails/{id} to follow the delivery from PENDING or SENDING to SENT or FAILED. SENT means the receiving SMTP server accepted the message. FAILED means the queue exhausted its retry attempts.
Track payment and review a transfer
| Request | What it does |
|---|---|
GET /payment-links?type=RESERVATION&targetId={reservationId} | Find existing links. Use page and pageSize to paginate. |
GET /payment-links/{id} | Read the effective status (ACTIVE, PAID, EXPIRED or CANCELLED) and paidAmount. |
GET /payment-links/{id}/transactions | Read paginated checkout attempts. Use status=AWAITING_REVIEW to find bank-transfer proofs waiting for review. |
GET /payment-links/{id}/transactions/{transactionId}/proof | Download the uploaded PDF or image as a file. |
POST /payment-links/{id}/transactions/{transactionId}/review | Send {"approve":true} after confirming the transfer, or {"approve":false,"note":"Reference could not be verified"} to reject the proof. Requires payments:write in addition to payment_links:write. |
POST /payment-links/{id}/cancel | Stop new payments on a link. Attempts already started can still settle. |
DELETE /payment-links/{id} | Remove the link when it has neither a successful payment nor an open attempt. |
Use separate idempotency keys for link creation, each email and each transfer decision. The API replays a successful response for the same key and request for 24 hours. A different body with the same key returns 422 IDEMPOTENCY_KEY_REUSED during that window. Bad fields return 400 VALIDATION_FAILED. A missing or other workspace’s resource returns 404 NOT_FOUND. A valid request rejected by payment rules returns 422 BUSINESS_RULE_VIOLATION. For 409 IDEMPOTENCY_IN_PROGRESS, 429 and 503, follow Retry-After when present and retry using the original key.
Schemas and samples for every endpoint are in the Payment links reference and the Emails reference.