# Capture Authorization

When a payment is authorized, the funds are held on the customer's card for seven days. The merchant can either directly capture a payment on its dashboard or by using this API. The transaction is cancelled if the merchant doesn't capture the authorization within seven days. Authorized payments can be captured either in full or partially.

Any capture amount less than the original transaction will be treated as a partial capture.

TIP

If the intent is set to sale while creating the payment, the authorized payment is automatically capture in full.

# Manual Capture

    Request example
    • Shell
    • JavaScript
    
    curl -X POST \
      https://api.ompay.com/v1/merchants/w3z8dfhkzvfq0j9n/payment/W94Q5D31NWIRD90XYUI8/capture \
      -H 'authorization: Basic ODZidWQ0Y2JremlxOXZmYzoweHI1ZDkwOHo2bmo4a2h6' \
      -H 'content-type: application/json' \
      -d '{
            "amount": "110.00",
            "invoice_number":"123456",	
            "custom":{
              "field1":"this is a test"
            }
          }
    
    Response example
    {
        "id": "4YC5R0FUJN6WQ7D8WN6V",
        "reference_id": "W94Q5D31NWIRD90XYUI8",
        "state": "captured",
        "result": {
            "code": "0000",
            "description": "Approved"
        },
        "transaction": {
            "amount": {
                "currency": "OMR",
                "total": "110.00"
            },
            "mode": "1",
            "invoice_number": "123455"
        },
        "custom": {},
        "chargeback": "N",
        "create_time": "2023-09-05T08:38:39Z"
    }
    

    # Request

    # Header parameters

    The request require a Basic authentication in the header. For more information about HTTP request headers, see HTTP request headers.

    # Request parameters

    Parameter Type Description
    merchant_id required string Encrypted Merchant account identifier for the Merchant
    reference_id required string Id of the initial transaction, usually this correspond to the authorisation ID.