Payments (Grow)
Process credit card payments and refunds through the Glance Grow payment gateway.
Use cases: Use the Payments API to charge customers directly, process refunds, and query transaction history.
POST
/grow/payments/chargeCharge a credit card.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
amount | number | required | Amount to charge. |
currency | string | 3-letter currency code (default "ILS"). | |
cardToken | string | required | Tokenized card reference from the payment form. |
description | string | Charge description. | |
clientId | number | Client visible ID to associate. | |
documentId | number | Document visible ID to associate. |
Request
curl -X POST "https://api.glance.co.il/grow/payments/charge" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"amount": 0,
"currency": "example_currency",
"cardToken": "example_cardToken",
"description": "example_description",
"clientId": 0,
"documentId": 0
}'Response
Response
{
"data": {
"transactionId": "txn_abc123def456",
"amount": 5850,
"currency": "ILS",
"status": "approved",
"last4": "4242",
"createdAt": "2024-03-20T14:30:00Z"
}
}POST
/grow/payments/refundRefund a previous transaction.
Body Parameters
| Name | Type | Description | |
|---|---|---|---|
transactionId | string | required | The original transaction ID to refund. |
amount | number | required | Amount to refund (can be partial). |
reason | string | Reason for the refund. |
Request
curl -X POST "https://api.glance.co.il/grow/payments/refund" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"transactionId": "example_transactionId",
"amount": 0,
"reason": "example_reason"
}'Response
Response
{
"data": {
"transactionId": "txn_ref_xyz789",
"originalTransactionId": "txn_abc123def456",
"amount": 2000,
"currency": "ILS",
"status": "refunded",
"reason": "Partial service cancellation",
"createdAt": "2024-03-20T15:00:00Z"
}
}GET
/grow/payments/transactionsList payment transactions.
Query Parameters
| Name | Type | Description | |
|---|---|---|---|
startDate | string | Filter from date (YYYY-MM-DD). | |
endDate | string | Filter to date (YYYY-MM-DD). | |
status | string | Filter by status (e.g. approved, refunded, declined). | |
page | number | Page number (default 1). | |
limit | number | Items per page (default 50). |
Request
curl -X GET "https://api.glance.co.il/grow/payments/transactions" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": [
{
"transactionId": "txn_abc123def456",
"amount": 5850,
"currency": "ILS",
"status": "approved",
"last4": "4242",
"client": {
"visibleId": 1,
"name": "Acme Corp"
},
"createdAt": "2024-03-20T14:30:00Z"
}
],
"pagination": {
"total": 320,
"limit": 50,
"offset": 0,
"hasMore": true
}
}GET
/grow/payments/transactions/:idGet a single transaction by ID.
Path Parameters
| Name | Type | Description | |
|---|---|---|---|
id | string | required | The transaction ID. |
Request
curl -X GET "https://api.glance.co.il/grow/payments/transactions/:id" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json"Response
Response
{
"data": {
"transactionId": "txn_abc123def456",
"amount": 5850,
"currency": "ILS",
"status": "approved",
"last4": "4242",
"cardBrand": "Visa",
"client": {
"visibleId": 1,
"name": "Acme Corp"
},
"document": {
"visibleId": 1001,
"type": "invoice"
},
"description": "Invoice #1001 payment",
"createdAt": "2024-03-20T14:30:00Z"
}
}