/capture

This API allows you to resume a CHALLENGE session initiated from a terminal.

❗️

Prerequisites to invoke this API:

  • Authenticate and send the bearer token for this call.
  • Send a call to /evaluate specifying "orderSource" : "terminal"

Request

Details

HTTP MethodPOST
Endpoint - Sandbox<https://api-sandbox.flex-charge.com/v1/capture>
Endpoint - Productionhttps://api.flex-charge.com/v1/capture
AuthenticationBearer Token

Body

idempotencyKeyGuidRequiredGenerate a GUID
orderIdGuidRequiredValue returned by /evaluate.
amountintRequiredThe amount to capture from the order. In cents
currencystringRequiredThe ISO 4217 currency code for the transaction.

.


Request example

curl --request POST \
    --url https://api-sandbox.flex-charge.com/v1/capture	
		--header 'Authorization: Bearer {bearer_token_returned_by_oauth2}' \	//replace with bearer returned by /oauth2
    --header 'accept: application/json' \
    --header 'content-type: application/*+json' \
    --data '
{
	"idempotencyKey": "{generate_a_GUID}",
  "orderId": "{same_orderId_returned_by_/evaluate_for_that_order}",
  "amount": 10000,
  "currency": "USD"
}

Response

After receiving a response from /capture, you need to update this order in your CRM with the corresponding status.

Status Code200
Response BodySUCCESS | FAILED

HTTP/1.1 200 OK
Content-Type: application/json

{
   "status": "SUCCESS | FAILED",
   "success": true,
   "result": null,
   "statusCode": null,
   "errors": [],
   "customProperties": {}
}
statusstringsuccess / fail
successbooleanIndicates if the API request was successful
resultstringThe result of the API request
Optional
statusCodestringThe status code of the API request
Optional
errorsarray of stringAny errors encountered during the API request
Optional
customPropertiesobjectAdditional custom properties for the API request
Optional