---
agentTools:
  projectIndex: https://sprinque.readme.io/llms.txt
---

# Capture

The Capture API is used to capture an authorization hold.
It is called once an invoice has been issued for the order.
It initiates the settlement of funds to the Merchant.

NOTE - **Merchant Order Id** shared in the Authorisation API call can be **overwritten** with the **Merchant Order Id** in the Capture API call. This is done to help provide flexibility to merchants who perform Auth with Sprinque before creating an order on their side.

# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "title": "Sprinque API",
    "version": "0.0.1",
    "description": "Sprinque API"
  },
  "paths": {
    "/api/v1/transactions/capture/{transaction_id}": {
      "post": {
        "operationId": "api_v1_transactions_capture_create",
        "description": "The Capture API is used to capture an authorization hold.\nIt is called once an invoice has been issued for the order.\nIt initiates the settlement of funds to the Merchant.",
        "summary": "Capture",
        "parameters": [
          {
            "in": "header",
            "name": "X-API-KEY-ID",
            "schema": {
              "type": "string"
            },
            "description": "Sprinque authenticates using API keys. \n    API Key can be generated on the Sprinque \n    MCC portal from the “My Account” page. \n    The same key can be used for all API calls.",
            "required": true,
            "explode": true
          },
          {
            "in": "path",
            "name": "transaction_id",
            "schema": {
              "type": "string"
            },
            "description": "Unique id of the transaction generated by Sprinque.",
            "required": true,
            "explode": false
          }
        ],
        "tags": [
          "Transactions"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionCapture"
              },
              "examples": {
                "RequestExample": {
                  "value": {
                    "invoice": {
                      "merchant_invoice_id": "kl0d8b99-bdba-4741-acde8860a9a32987",
                      "url": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
                      "date": "2022-01-31",
                      "currency": "EUR",
                      "amount": 99.99
                    },
                    "shipment": {
                      "shipped_on": "2022-01-31",
                      "carrier": "DHL",
                      "tracking_number": "90210",
                      "address": {
                        "address_line1": "Lela Path 99",
                        "address_line2": "#221",
                        "city": "Liza Spurs",
                        "zip_code": "65568",
                        "country_code": "NL"
                      }
                    },
                    "metadata": {
                      "additionalProp1": "string",
                      "additionalProp2": "string",
                      "additionalProp3": "string"
                    }
                  },
                  "summary": "Request Example"
                }
              }
            },
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TransactionCapture"
              }
            },
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/TransactionCapture"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionCapture"
                }
              }
            },
            "description": ""
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "CaptureInvoiceDetails": {
        "type": "object",
        "properties": {
          "invoice_id": {
            "type": "string",
            "readOnly": true,
            "description": "Unique ID generated for each invoice registered with Sprinque."
          },
          "merchant_invoice_id": {
            "type": "string",
            "description": "Invoice number generated by the merchant."
          },
          "url": {
            "type": "string",
            "format": "uri",
            "description": "Url generated by the merchant from where the invoice pdf can be downloaded."
          },
          "file_id": {
            "type": "string",
            "description": "Either URL or file_id of the invoice is needed for capture. File_id can be generated by calling the upload_file api"
          },
          "additional_file_url": {
            "type": "string",
            "format": "uri",
            "description": "Url generated by the merchant from where the additional pdf can be downloaded."
          },
          "amount": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,98}(?:\\.\\d{0,2})?$",
            "description": "The monetary value of the invoice."
          },
          "currency": {
            "type": "string",
            "default": "EUR",
            "description": "Currency code in ISO 4217."
          },
          "date": {
            "type": "string",
            "format": "date",
            "description": "Date of invoice. Format YYYY-MM-DD"
          },
          "status": {
            "type": "string",
            "readOnly": true,
            "description": "Current status of the invoice from predefined values: Open."
          },
          "due_date": {
            "type": "string",
            "format": "date",
            "readOnly": true,
            "description": "Due date of the invoice (date of invoice creation plus payment term). Format YYYY-MM-DD"
          },
          "settlement_date": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "This field is used to specify the settlement date for dynamic settlements if this feature is enabled for the merchant."
          }
        },
        "required": [
          "amount",
          "date",
          "due_date",
          "invoice_id",
          "merchant_invoice_id",
          "status"
        ]
      },
      "Country": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "nullable": true,
            "description": "Name of the country the order is being shipped to."
          },
          "code": {
            "type": "string",
            "description": "2 character country code the order is being shipped to."
          }
        },
        "required": [
          "code"
        ]
      },
      "PBIAddress": {
        "type": "object",
        "properties": {
          "address_line1": {
            "type": "string",
            "description": "Line 1 of the address the order is being shipped to."
          },
          "address_line2": {
            "type": "string",
            "nullable": true,
            "description": "Line 2 of the address the order is being shipped to."
          },
          "city": {
            "type": "string",
            "description": "City the order is being shipped to."
          },
          "zip_code": {
            "type": "string",
            "description": "Zip code the order is being shipped to."
          },
          "country_code": {
            "type": "string",
            "writeOnly": true,
            "description": "2 character country code the order is being shipped to."
          },
          "country": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Country"
              }
            ],
            "readOnly": true,
            "description": "Country the order is being shipped to."
          }
        },
        "required": [
          "address_line1",
          "city",
          "country",
          "country_code",
          "zip_code"
        ]
      },
      "ShipmentDetails": {
        "type": "object",
        "properties": {
          "shipped_on": {
            "type": "string",
            "format": "date",
            "nullable": true,
            "description": "Date order was shipped. Format YYYY-MM-DD"
          },
          "carrier": {
            "type": "string",
            "description": "Carrier through whom  shipment was sent. Example - DHL, PostNL etc."
          },
          "tracking_number": {
            "type": "string",
            "description": "Tracking number of the shipment."
          },
          "address": {
            "allOf": [
              {
                "$ref": "#/components/schemas/PBIAddress"
              }
            ],
            "description": "Address the order is being shipped to."
          }
        },
        "required": [
          "address"
        ]
      },
      "TransactionCapture": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "readOnly": true,
            "description": "Unique ID for each transaction lifecycle call to Sprinque."
          },
          "invoice": {
            "$ref": "#/components/schemas/CaptureInvoiceDetails"
          },
          "shipment": {
            "allOf": [
              {
                "$ref": "#/components/schemas/ShipmentDetails"
              }
            ],
            "description": "Address the order is being shipped to."
          },
          "available_credit_balance": {
            "type": "string",
            "format": "decimal",
            "pattern": "^-?\\d{0,98}(?:\\.\\d{0,2})?$",
            "readOnly": true,
            "description": "Available credit limit after capture."
          },
          "transaction_status": {
            "type": "string",
            "readOnly": true,
            "description": "Transaction status indicates the current state of a transaction. Possible values: CAPTURED, CAPTURE DECLINED, SETTLED"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": {},
            "description": "Metadata is a JSON object for passing any custom information like the digital footprint of the buyer. (e.g., IP address, browser type etc)"
          },
          "trace_id": {
            "type": "string",
            "readOnly": true,
            "description": "Unique ID generated by Sprinque for each API call."
          },
          "merchant_order_id": {
            "type": "string",
            "description": "Order id generated by the merchant."
          },
          "pay_page_url": {
            "type": "string",
            "format": "uri",
            "readOnly": true,
            "description": "Link to pay page for this invoice."
          }
        },
        "required": [
          "available_credit_balance",
          "invoice",
          "pay_page_url",
          "shipment",
          "trace_id",
          "transaction_id",
          "transaction_status"
        ]
      }
    }
  },
  "servers": [
    {
      "url": "https://api-sandbox.sprinque.com/"
    }
  ],
  "x-readme": {
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "_id": {
    "buffer": {
      "0": 97,
      "1": 196,
      "2": 193,
      "3": 177,
      "4": 38,
      "5": 35,
      "6": 143,
      "7": 0,
      "8": 119,
      "9": 202,
      "10": 120,
      "11": 78
    }
  }
}
```