On this page
Payment collect
Payment collect is how your system asks a customer to pay a specific amount. You create a payment link, send the customer to that link, and Cutflow hosts the card page. When the customer finishes, Cutflow notifies your system.
Your server keeps the access key. The link you give the customer is only a checkout page. It does not carry the access key.
Base URL: https://api.cutflow.app/v1
How a payment works
- List the card merchants for the business and choose the one that should receive the money.
- Create a payment link for an amount. Save
paymentCode. Giveurlto the customer. - The customer pays on the Cutflow page. You can poll the link if you want the current status.
- Cutflow posts
payment-collect-finishedto every webhook you registered, when the link is paid or cancelled. - After a successful payment, the customer’s browser is sent to your callback URL.
| Status | Meaning |
|---|---|
| pending | The link is waiting for the customer. You can still cancel it. |
| processing | A charge is in progress. Wait for paid, or for the link to return to pending if the charge is declined. |
| paid | The customer paid. A paid link cannot be cancelled, and trying to cancel it does not refund the charge. |
| cancelled | You cancelled the link before a charge started. |
Authentication
Create an access key in Cutflow, under Payment collect, and store it on your server. Send it on every request:
Authorization: Bearer <access key>
Content-Type: application/jsonA failed call returns JSON:
| Field | Type | Description |
|---|---|---|
reference |
string | Stable code to match in your client. |
message |
string | Short description of the failure. |
details |
any | Extra information. Omitted when there is none. |
{
"reference": "general/bad_request",
"message": "bad request, malformed body"
}| HTTP | reference |
message |
When |
|---|---|---|---|
| 400 | general/missing_headers |
missing headers |
The Authorization header is missing. |
| 401 | auth/unauthorized |
invalid authentication details provided |
The access key is not accepted. |
| 400 | general/bad_request |
bad request, malformed body |
The body or the link state cannot be accepted. |
| 404 | general/record_not_found |
record not found |
No payment link with that code belongs to this access key. |
| 404 | proceesor_merchant/not_found |
processor merchant not found |
processorMerchantId is not one of this business’s merchants. |
Payment link object
Create, retrieve, and cancel all return this object.
| Field | Type | Description |
|---|---|---|
paymentCode |
string | Code Cutflow assigns to this link. Keep it. You pass it to check the status or cancel the link, and Cutflow sends the same code on the webhook and the callback so you know which link finished. |
url |
string | Hosted checkout page. Give this to the customer. |
amount |
number | Charge before tax, rounded to 2 decimals. |
tax |
number | Tax, rounded to 2 decimals. 0 when you omit tax. |
total |
number | amount plus tax, rounded to 2 decimals. Cutflow calculates this. |
currency |
string | usd, cad, dop, or eur. Cutflow sets this from the business country. A business with no country currency uses usd. |
status |
string | pending, processing, paid, or cancelled. |
context |
string or null | The string you sent at creation, returned unchanged. null when you did not send one. Cutflow also returns this value on the webhook and on the callback URL. |
{
"paymentCode": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"url": "https://shop.example/collect/7c9e6679-7425-40de-944b-e07fc1f90ae7",
"amount": 25,
"tax": 2,
"total": 27,
"currency": "usd",
"status": "pending",
"context": "order-1001"
}List merchants
/payment-collect/merchantsReturns the card merchants that can receive a payment link. Call this before you create a link, and pass the merchant id as processorMerchantId.
No request body.
Response 200
| Field | Type | Description |
|---|---|---|
merchants |
array | Merchants for the business that owns the access key. Empty when the business has none. |
merchants[].id |
string | Merchant id. A UUID. Send this value as processorMerchantId. |
merchants[].processor |
string | Card processor. One of stripe, azul, tsys, cardnet, sabadell, globalpayments, mastercard, magensa, godaddy. |
merchants[].mid |
string or null | Merchant number at the processor. |
merchants[].description |
string or null | Name shown for this merchant in Cutflow. |
{
"merchants": [
{
"id": "480a875b-a75d-4ab7-b687-dba76500feab",
"processor": "tsys",
"mid": "123456789",
"description": "Main merchant"
}
]
}Create a payment link
/payment-collect/requestsCreates a link in pending status. Cutflow sets total, currency, paymentCode, and url.
Request
| Field | Type | Required | Description |
|---|---|---|---|
processorMerchantId |
string | yes | Merchant id from List merchants. A UUID. |
amount |
number | yes | Amount before tax. Must be greater than 0. Rounded to 2 decimals. |
tax |
number | no | Tax. Defaults to 0. Must be 0 or greater. Rounded to 2 decimals. |
context |
string | no | A value you want back with this payment. Cutflow stores it and returns the same string on the webhook and as a query parameter on the callback URL, so your system can tell which order finished. At most 255 characters. Blank becomes null. A number or object is rejected. |
{
"processorMerchantId": "480a875b-a75d-4ab7-b687-dba76500feab",
"amount": 25,
"tax": 2,
"context": "order-1001"
}Response 200
A payment link object. status is pending.
Errors
| HTTP | reference |
When |
|---|---|---|
| 400 | general/bad_request |
The merchant id is missing or is not a UUID, amount is missing or not greater than 0, tax is negative, or context is not a string of at most 255 characters. |
| 404 | proceesor_merchant/not_found |
That merchant does not belong to this access key. |
Retrieve a payment link
/payment-collect/requests/:paymentCodeReturns the current link. Poll this when you need the status and you have not received the webhook yet.
Path
| Field | Type | Required | Description |
|---|---|---|---|
paymentCode |
string | yes | paymentCode from the create response. |
No request body.
Response 200
Errors
| HTTP | reference |
When |
|---|---|---|
| 404 | general/record_not_found |
No link with that code belongs to this access key. |
Cancel a payment link
/payment-collect/requests/:paymentCode/cancelCancels a link that is still pending. The customer can no longer pay it. Cutflow then posts payment-collect-finished with status cancelled.
A processing or paid link cannot be cancelled, and the call returns 400. Trying to cancel a paid link does not refund the charge.
Path
| Field | Type | Required | Description |
|---|---|---|---|
paymentCode |
string | yes | paymentCode from the create response. |
No request body.
Response 200
A payment link object. status is cancelled.
Errors
| HTTP | reference |
When |
|---|---|---|
| 400 | general/bad_request |
The link is processing, paid, or already cancelled. |
| 404 | general/record_not_found |
No link with that code belongs to this access key. |
Register a webhook or a callback
/payment-collect/hooksRegisters where Cutflow should contact you.
- A webhook is a server endpoint. Cutflow sends an HTTP
POSTwith JSON when a link is paid or cancelled. You can register more than one. Every registered webhook receives the event. - A callback is a page in the customer’s browser. After a successful payment, Cutflow sends the browser to that URL. The business has one callback. Registering another callback replaces the previous URL.
Request
| Field | Type | Required | Description |
|---|---|---|---|
type |
string | yes | webhook or callback. |
url |
string | yes | http or https URL, at most 2048 characters. The host must be public. Localhost, private networks, and cloud metadata addresses are rejected. A username or password in the URL is rejected. Cutflow does not follow a redirect from this URL. |
secret |
string | no | Signing secret for a webhook, at most 255 characters. Blank means the webhook is unsigned. Ignored for a callback. Cutflow never returns this value. |
{
"type": "webhook",
"url": "https://example.com/cutflow",
"secret": "your-signing-secret"
}Response 200
| Field | Type | Description |
|---|---|---|
id |
number | Id of this registration. The same id is used in a test delivery. |
businessId |
number | Business that owns the access key. |
name |
string | payment-collect-finished-webhook or payment-collect-finished-callback. |
type |
string | webhook or callback. |
url |
string | URL Cutflow will call. |
createdAt |
string | When the registration was created, ISO 8601. |
updatedAt |
string | When the registration was last changed, ISO 8601. A replaced callback updates this time. |
{
"id": 12,
"businessId": 362,
"name": "payment-collect-finished-webhook",
"type": "webhook",
"url": "https://example.com/cutflow",
"createdAt": "2026-12-03T16:00:00.000Z",
"updatedAt": "2026-12-03T16:00:00.000Z"
}Errors
| HTTP | reference |
When |
|---|---|---|
| 400 | general/bad_request |
type is not webhook or callback, the URL is missing or not a public http/https address, or secret is not a string of at most 255 characters. |
Send a test webhook
/payment-collect/hooks/testPosts a sample payment-collect-finished body to every webhook named payment-collect-finished-webhook. The sample uses a random paymentCode, status paid, amount 1, tax 0, total 1, the business currency, and context "test". It is signed when that webhook has a secret.
No request body. This does not create a payment link and does not call the callback URL.
Response 200
| Field | Type | Description |
|---|---|---|
deliveries |
array | One entry per registered webhook. A failure of one destination does not stop the others. |
deliveries[].id |
number | Webhook registration id. |
deliveries[].url |
string | URL that was called. |
deliveries[].status |
number or null | HTTP status returned by your server. null when your server did not answer within 5 seconds. |
{
"deliveries": [
{
"id": 12,
"url": "https://example.com/cutflow",
"status": 200
}
]
}Errors
| HTTP | reference |
When |
|---|---|---|
| 400 | general/bad_request |
No payment-collect webhook is registered. |
Webhook: payment-collect-finished
Cutflow sends this HTTP POST to each registered webhook when a link becomes paid or cancelled. The body is JSON. The request waits at most 5 seconds. A failed delivery is not retried by a later poll; retrieve the link if you need to confirm the status.
Verify the signature against the raw body before you trust the JSON. The header is present only when that webhook was registered with a secret:
Content-Type: application/json
X-Cutflow-Signature: sha256=<hex>hex is HMAC-SHA256 of the exact raw body, using the webhook secret, encoded as lowercase hexadecimal.
Body
| Field | Type | Description |
|---|---|---|
event |
string | Always payment-collect-finished. |
paymentCode |
string | Same code returned when the link was created. Use it to match this event to that link. |
businessId |
number | Business that owns the link. |
status |
string | paid or cancelled. |
amount |
number | Amount before tax. |
tax |
number | Tax. |
total |
number | Amount plus tax. |
currency |
string | usd, cad, dop, or eur. |
context |
string or null | The context you sent when creating the link, returned so you can match this event to your own order. null when you did not send one. |
{
"event": "payment-collect-finished",
"paymentCode": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
"businessId": 362,
"status": "paid",
"amount": 25,
"tax": 2,
"total": 27,
"currency": "usd",
"context": "order-1001"
}Respond with any HTTP 2xx. Cutflow records other statuses as a failed delivery and still delivers the event to your remaining webhooks.
Callback
The callback is a browser redirect after the customer pays. Cutflow does not POST to it.
The address is the newest callback URL, with these query parameters:
| Parameter | Required | Description |
|---|---|---|
status |
yes | Link status after payment. This is paid for a completed checkout. |
paymentCode |
yes | Same code returned when the link was created. |
context |
no | The context you sent when creating the link, returned as a query parameter. Omitted when you did not send one. |
https://example.com/paid?status=paid&paymentCode=7c9e6679-7425-40de-944b-e07fc1f90ae7&context=order-1001The redirect is not signed. Confirm the payment with the webhook, or with Retrieve a payment link, before you fulfill the order.