Capture & Void
POST /payment/s2s/capture and /payment/s2s/void.
After a successful authorization (auth: Y on direct sale), use capture to settle funds or void to release the hold.
Auth + capture flow: Direct sale with
auth: Yholds funds only. You must call capture to settle or void to release before the authorization expires.
Capture sequence
sequenceDiagram
autonumber
participant Merchant as Your Server
participant DigetPay as DigetPay API
participant Gateway as Payment Gateway
Note over Merchant,Gateway: Prior auth completed (paymentId / transactionId stored)
Merchant->>DigetPay: POST /payment/s2s/capture<br/>{ transactionId, amount }
DigetPay->>Gateway: Capture request
Gateway-->>DigetPay: ACCEPTED
DigetPay-->>Merchant: data.result, data.action=CAPTURE
Gateway->>DigetPay: Async webhook (type: Capture)
DigetPay->>Merchant: Forward to merchantCallbackUrl
Void sequence
sequenceDiagram
autonumber
participant Merchant as Your Server
participant DigetPay as DigetPay API
participant Gateway as Payment Gateway
Merchant->>DigetPay: POST /payment/s2s/void<br/>{ transactionId }
DigetPay->>Gateway: Void / credit void
Gateway-->>DigetPay: ACCEPTED
DigetPay-->>Merchant: data.result, data.action=CREDITVOID
Capture
| Method | POST |
| URL | /v1/payment/s2s/capture |
| Field | Required | Description |
|---|---|---|
transactionId | Yes | Gateway transaction ID from auth |
amount | Yes | Amount to capture |
Request payload — Capture
{
"transactionId": "c09fba3c-59e2-434a-9ec1-5d2e71a44a8d",
"amount": 100
}Important: Capture amount must not exceed the authorized amount.
Void
| Method | POST |
| URL | /v1/payment/s2s/void |
| Field | Required | Description |
|---|---|---|
transactionId | Yes | Gateway transaction ID from auth |
Request payload — Void
{
"transactionId": "c09fba3c-59e2-434a-9ec1-5d2e71a44a8d"
}Critical: Void only works on uncaptured authorizations. If the transaction was already captured, void returns
400.
Responses — Capture
{
"success": {
"status": 200,
"body": {
"code": 200,
"message": "Success",
"errorCode": null,
"data": {
"result": "ACCEPTED",
"action": "CAPTURE",
"rrn": "609211307265",
"order_id": "817922228",
"trans_id": "0808779145497567115585",
"card_brand": "MASTER",
"decline_reason": null
}
}
}
}{
"failed": {
"status": 400,
"body": {
"code": 400,
"message": "Capture amount exceeds authorized amount",
"errorCode": "400",
"data": null
}
}
}{
"failed_unauthorized": {
"status": 401,
"body": {
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}
}
}Responses — Void
{
"success": {
"status": 200,
"body": {
"code": 200,
"message": "Success",
"errorCode": null,
"data": {
"result": "ACCEPTED",
"action": "CREDITVOID",
"rrn": "609211298866",
"order_id": "8179222228",
"trans_id": "0808779145497567115585",
"card_brand": "MASTER",
"decline_reason": null
}
}
}
}{
"failed": {
"status": 400,
"body": {
"code": 400,
"message": "Transaction already captured",
"errorCode": "400",
"data": null
}
}
}{
"failed_unauthorized": {
"status": 401,
"body": {
"statusCode": 401,
"message": "Missing API key",
"error": "Unauthorized"
}
}
}Updated 14 days ago
Did this page help you?
