Sale Transaction
Endpoint for initiating Sale type of Transactions.
info
Please be aware that this endpoint requires a Manage Transactions API Key.
POST /api/v1/groups/{group_id}/transaction
info
Available countries: US, CA, UK.
info
Dynamic descriptor: This feature requires pre-configuration by our Support Team. Reach out to us to enable this feature for your account.
Request Parameters
Name | Description | Type | Required |
---|---|---|---|
amounts.requested_amount | The amount requested for the transaction. | uint64 | Required |
amounts.included_tax_amount | The tax amount included in the requested amount. | uint64 | |
amounts.included_shipping_amount | The shipping amount included in the requested amount. | uint64 | |
billing_address.city | City of the Billing Address. | string | Required |
billing_address.company | Company Name of the Billing Address. | string | |
billing_address.country | Country of the Billing Address. | string | Required |
billing_address.email | Email address of the Billing Address. | string | Required |
billing_address.first_name | First Name of the Billing Address used for the Customer charged. | string | Required |
billing_address.last_name | Last Name of the Billing Address used for the Customer charged. | string | Required |
billing_address.line_1 | First Address line of the Billing Address. | string | Required |
billing_address.line_2 | Second Address line of the Billing Address. | string | |
billing_address.postal_code | Postal Code of the Billing Address. | string | Required |
billing_address.subdivision | Subdivision of the Billing Address. | string | Required |
currency | Currency of the transaction. Currently supported currencies: USD | string | Required |
description | Description of the transaction. | string | |
email_address | Email address associated with the transaction. | string | Required |
email_receipt | Sending an email receipt of the transaction to the associated email address. | boolean | Required |
ip_address | Sender's IP address | string | |
order_id | Order ID of the transaction. | string | |
payment_details.token | Token generated with the Tokenizer for the transaction. | string | Required |
payment_details.card_details.dynamic_descriptor | An optional override of the default card statement descriptor for the transaction. | string | |
po_number | PO Number of the transaction. | string | |
processor_id | Processor ID used for the transaction. | string | Required |
shipping_address.city | City of the Shipping Address. | string | |
shipping_address.country | Country of the Shipping Address. | string | |
shipping_address.first_name | First Name of the Shipping Address used for the Customer charged. | string | |
shipping_address.last_name | Last Name of the Shipping Address used for the Customer charged. | string | |
shipping_address.line_1 | First Address line of the Shipping Address. | string | |
shipping_address.line_2 | Second Address line of the Shipping Address. | string | |
shipping_address.postal_code | Postal Code of the Shipping Address. | string | |
shipping_address.subdivision | Subdivision of the Shipping Address. | string | |
source | Source of the transaction. Available sources: api ,forms ,recurring , virtual_terminal | string | Required |
type | sale | string | Required |
Response
Code | Description |
---|---|
200 | Success |
400 | Bad Request / Validation error |
500 | Internal Error |
Example Usage
- JavaScript
- Python
- Go
transaction.js
var headers = new Headers();
headers.append('Authorization', 'API_KEY');
var requestOptions = {
method: 'POST',
headers: headers,
redirect: 'follow',
body: {
// request body data
}
};
const group_id = '';
fetch(`https://api.reverepayments.dev/api/v1/groups/${group_id}/transaction`, requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
transaction.py
import requests
url = "https://api.reverepayments.dev/api/v1/groups/{group_id}/transaction"
headers = {
'Authorization': 'API_KEY'
}
response = requests.request("POST", url, headers=headers, json={
// request body data
})
print(response.text)
transaction.go
package main
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net/http"
)
func main() {
url := "https://api.reverepayments.dev/api/v1/groups/{group_id}/transaction"
client := &http.Client{}
body := bytes.NewBuffer(nil)
_ = json.NewEncoder(body).Encode(map[string]any{
// body data
})
req, _ := http.NewRequest("POST", url, body)
req.Header.Add("Authorization", "API_KEY")
res, _ := client.Do(req)
defer res.Body.Close()
bytes, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err.Error())
return
}
fmt.Println(string(bytes))
}
Example Request
{
"source": "api",
"type": "sale",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed lacus ac mi gravida euismod. Curabitur augue sapien, aliquam eu varius eu, gravida ac nunc. Duis commodo imperdiet augue. Proin consequat odio et pretium molestie.",
"payment_details": {
"token": "<token_id>",
"card_details": {
"dynamic_descriptor": "Lorem ipsum"
}
},
"order_id": "98765",
"po_number": "12345",
"email_address": "test@example.com",
"email_receipt": false,
"processor_id": "0599c001-e66e-4ead-91b6-ae2e54b49819",
"currency": "USD",
"shipping_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"country": "US",
"subdivision": "PA",
"postal_code": "18505"
},
"billing_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"country": "US",
"subdivision": "PA",
"postal_code": "18505",
"email": "test@example.com"
},
"amounts": {
"requested_amount": 3000,
"included_shipping_amount": 1000,
"included_tax_amount": 300
}
}
Example Success Response
{
"id": "c05861f0-6384-414d-b837-0ed71cefbbe5",
"group_id": "<group_id>",
"gateway": "revere_pay",
"processor_id": "<processor_id>",
"processor_name": "NO AFFILIATE",
"processor_type": "revere_pay",
"transaction_type": "sale",
"payment_method": "card",
"payment_details": {
"card": {
"brand": "Visa",
"first_six": "411111",
"last_four": "1111",
"customer_name": "James Testington",
"expiration_date": "26/11",
"avs": "not available",
"cvv": "no match",
"issued_country": "US",
"dynamic_descriptor": "Lorem ipsum"
}
},
"amounts": {
"requested_amount": 3000,
"authorized_amount": 3000,
"captured_amount": 3000,
"included_tax_amount": 300,
"included_shipping_amount": 1000
},
"currency": "USD",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Fusce sed lacus ac mi gravida euismod. Curabitur augue sapien, aliquam eu varius eu, gravida ac nunc. Duis commodo imperdiet augue. Proin consequat odio et pretium molestie.",
"source": "api",
"order_id": "98765",
"po_number": "12345",
"email_receipt": false,
"email_address": "test@example.com",
"billing_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"subdivision": "PA",
"postal_code": "18505",
"country": "US",
"email": "test@example.com"
},
"shipping_address": {
"first_name": "James",
"last_name": "Testington",
"company": "James' Company",
"city": "Scranton",
"line_1": "Slough Avenue",
"line_2": "1725",
"subdivision": "PA",
"postal_code": "18505",
"country": "US"
},
"form_external_id": "",
"form_entry_id": "",
"subscription_id": "",
"plan_id": "",
"custom_fields": {},
"response_code": "SUCCESS",
"response_text": "confirmed",
"status": "pending",
"created_at": "2024-04-11T14:27:17.952372849Z"
}