Skip to main content
POST
https://api.lite.sa/v1
/
payments
/
{payment_id}
/
capture
Capture an authorized payment
curl --request POST \
  --url https://api.lite.sa/v1/payments/{payment_id}/capture \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "amount": 10000,
  "metadata": {
    "order_id": "ORD-123",
    "order_status": "shipped",
    "tracking_number": "TRACK123",
    "is_final": false
  }
}
'
import requests

url = "https://api.lite.sa/v1/payments/{payment_id}/capture"

payload = {
"amount": 10000,
"metadata": {
"order_id": "ORD-123",
"order_status": "shipped",
"tracking_number": "TRACK123",
"is_final": False
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10000,
metadata: {
order_id: 'ORD-123',
order_status: 'shipped',
tracking_number: 'TRACK123',
is_final: false
}
})
};

fetch('https://api.lite.sa/v1/payments/{payment_id}/capture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 10000,
metadata: {
order_id: 'ORD-123',
order_status: 'shipped',
tracking_number: 'TRACK123',
is_final: false
}
})
};

fetch('https://api.lite.sa/v1/payments/{payment_id}/capture', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.lite.sa/v1/payments/{payment_id}/capture"

payload := strings.NewReader("{\n \"amount\": 10000,\n \"metadata\": {\n \"order_id\": \"ORD-123\",\n \"order_status\": \"shipped\",\n \"tracking_number\": \"TRACK123\",\n \"is_final\": false\n }\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.lite.sa/v1/payments/{payment_id}/capture",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 10000,
'metadata' => [
'order_id' => 'ORD-123',
'order_status' => 'shipped',
'tracking_number' => 'TRACK123',
'is_final' => false
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
{
  "payment": {
    "id": "baf6a8e2-0c89-46ef-9ca5-faa65b99bcd5",
    "status": "PENDING",
    "merchant_reference": "ORD-123456"
  },
  "_links": {
    "self": {
      "href": "<string>",
      "method": "POST"
    },
    "capture": {
      "href": "<string>",
      "method": "POST"
    },
    "void": {
      "href": "<string>",
      "method": "POST"
    },
    "refund": {
      "href": "<string>",
      "method": "POST"
    },
    "redirect": {
      "href": "<string>",
      "method": "POST"
    }
  }
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}
{
"error": {
"code": "PAYMENT_DETAILS_MISMATCH",
"message": "The request was invalid or malformed",
"timestamp": "2024-12-16T10:30:00.000Z",
"details": {},
"correlationId": "550e8400-e29b-41d4-a716-446655440000"
}
}

Authorizations

x-api-key
string
header
required

API key for service-to-service or merchant authentication.

Headers

x-correlation-id
string<uuid>

Unique identifier for request tracing. Generated by the client or server if not provided.

Example:

"550e8400-e29b-41d4-a716-446655440000"

x-idempotency-key
string<uuid>

Unique key for idempotent request processing. Duplicate requests with the same key are safely ignored.

Example:

"baf6a8e2-0c89-46ef-9ca5-faa65b99bcd5"

Path Parameters

payment_id
string<uuid>
required

Unique identifier of the payment

Example:

"9822ffb8-26de-423b-ad15-0d129cf1b4ac"

Body

application/json

Capture an authorized payment

Capture amount and metadata. If amount is omitted, the full authorized amount is captured.

amount
integer

Amount to capture in minor units (e.g. 10000 for 100.00 SAR). Omit to capture full authorized amount.

Required range: x >= 1
Example:

10000

metadata
object

Additional metadata. Set is_final to true for the final capture.

Example:
{
"order_id": "ORD-123",
"order_status": "shipped",
"tracking_number": "TRACK123",
"is_final": false
}

Response

Payment accepted for processing.

payment
object
required

Available action links (HATEOAS)