Capture a Transaction
POSThttps://useast.api.elasticpath.com/v2/orders/:orderID/transactions/:transactionID/capture
Use this endpoint to capture a previously authorized payment. In this step, you can also pass in a custom reference, such as the payment reference from your chosen gateway.
Request
Path Parameters
orderID stringrequired
The UUID of the order.
transactionID stringrequired
The UUID of the transaction to capture.
- application/json
Body
data object
Responses
- 200
- 400
Response Headers
- application/json
- Schema
- Example (auto)
Schema
data objectrequired
{
"data": {
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"reference": "string",
"name": "string",
"custom_reference": "string",
"gateway": "adyen",
"amount": 0,
"refunded_amount": 0,
"currency": "string",
"transaction-type": "string",
"status": "string",
"relationships": {
"order": {
"data": {
"type": "string",
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
}
}
},
"meta": {
"display_price": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"display_refunded_amount": {
"amount": 0,
"currency": "string",
"formatted": "string"
},
"timestamps": {
"created_at": "2023-11-07T23:04:18.845Z",
"updated_at": "2023-11-07T23:04:18.845Z"
}
}
}
}
Bad Request
- application/json
- Schema
- Example (auto)
- default
Schema
errors object[]required
{
"errors": [
{
"title": "string",
"detail": "string",
"meta": {
"id": "string",
"ids": [
"string"
],
"item_ids": [
"string"
],
"shipping_group_id": "string",
"shipping_group_ids": [
"string"
],
"cart_id": "string",
"code": "string",
"order_id": "string"
}
}
]
}
Required field missing
{
"errors": [
{
"detail": "Request could not be processed",
"status": "400",
"title": "Bad Request"
}
]
}
Authorization: http
name: bearerAuthtype: httpscheme: bearer
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://useast.api.elasticpath.com/v2/orders/:orderID/transactions/:transactionID/capture");
request.Headers.Add("Accept", "application/json");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("{\n \"data\": {\n \"options\": {\n \"soft_descriptor\": \"string\",\n \"note_to_payer\": \"string\"\n }\n }\n}", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
ResponseClear