Skip to main content
POST
/
v1
/
transactions
/
{id}
/
refund
Refund transaction
curl --request POST \
  --url https://api.hyperline.co/v1/transactions/{id}/refund \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.hyperline.co/v1/transactions/{id}/refund"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.text)
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.hyperline.co/v1/transactions/{id}/refund', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
  CURLOPT_URL => "https://api.hyperline.co/v1/transactions/{id}/refund",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_HTTPHEADER => [
    "Authorization: Bearer <token>"
  ],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
  echo "cURL Error #:" . $err;
} else {
  echo $response;
}
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.hyperline.co/v1/transactions/{id}/refund"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.hyperline.co/v1/transactions/{id}/refund")
  .header("Authorization", "Bearer <token>")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://api.hyperline.co/v1/transactions/{id}/refund")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
{
  "id": "tra_2QdJDDUej969ev",
  "type": "subscription",
  "amount": 31500,
  "currency": "EUR",
  "customer_id": "cus_QalW2vTAdkR6IY",
  "provider_id": "<string>",
  "process_at": "2024-11-12T07:38:39.222Z",
  "settled_at": "2024-11-12T07:38:39.222Z",
  "refunded_at": null,
  "last_refreshed_at": null,
  "provider_fee": null,
  "chargeback": null,
  "integrations": [
    {
      "entity_id": "123456789",
      "provider_name": "stripe",
      "provider_account_id": "acc_1234567890"
    }
  ],
  "payment_method": {
    "id": "pm_1xMpj5bwRqN7LM",
    "status": "active",
    "type": "card",
    "last_4_digits": 2718,
    "expiration_date": "2027-11",
    "brand": "<string>"
  },
  "status": "settled"
}
{
  "message": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Response

The created refund transaction.

id
string
required

Transaction ID.

Example:

"tra_2QdJDDUej969ev"

type
enum<string>
required

Transaction type.

  • subscription: The transaction is related to a subscription payment.
  • one_time: The transaction is related to a one-time payment.
  • refund: The transaction is related to a refund payment.
Available options:
subscription,
one_time,
refund
Example:

"subscription"

amount
number
required

Transaction amount.

Example:

31500

currency
enum<string>
required

Transaction currency.

Available options:
EUR,
AED,
AFN,
XCD,
ALL,
AMD,
AOA,
ARS,
USD,
AUD,
AWG,
AZN,
BAM,
BBD,
BDT,
BGN,
BHD,
BIF,
XOF,
BMD,
BND,
BOB,
BRL,
BSD,
BTN,
NOK,
BWP,
BYR,
BZD,
CAD,
CDF,
XAF,
CHF,
NZD,
CLP,
CNY,
COP,
CRC,
CUP,
CVE,
ANG,
CZK,
DJF,
DKK,
DOP,
DZD,
EGP,
MAD,
ERN,
ETB,
FJD,
FKP,
GBP,
GEL,
GHS,
GIP,
GMD,
GNF,
GTQ,
GYD,
HKD,
HNL,
HRK,
HTG,
HUF,
IDR,
ILS,
INR,
IQD,
IRR,
ISK,
JMD,
JOD,
JPY,
KES,
KGS,
KHR,
KMF,
KPW,
KRW,
KWD,
KYD,
KZT,
LAK,
LBP,
LKR,
LRD,
LSL,
LYD,
MDL,
MGA,
MKD,
MMK,
MNT,
MOP,
MRO,
MUR,
MVR,
MWK,
MXN,
MYR,
MZN,
NAD,
XPF,
NGN,
NIO,
NPR,
OMR,
PAB,
PEN,
PGK,
PHP,
PKR,
PLN,
PYG,
QAR,
RON,
RSD,
RUB,
RWF,
SAR,
SBD,
SCR,
SDG,
SEK,
SGD,
SHP,
SLL,
SOS,
SRD,
SSP,
STD,
SYP,
SZL,
THB,
TJS,
TMT,
TND,
TOP,
TRY,
TTD,
TWD,
TZS,
UAH,
UGX,
UYU,
UZS,
VEF,
VND,
VUV,
WST,
YER,
ZAR,
ZMW,
ZWL
Example:

"EUR"

customer_id
string
required

ID of the customer linked to the transaction.

Example:

"cus_QalW2vTAdkR6IY"

provider_id
string | null
required
deprecated

Deprecated field, please use integrations[].entity_id.

process_at
string<date-time>
required

Date corresponding to the processing of the transaction. If in the future, the transaction is scheduled to be processed.

Example:

"2024-11-12T07:38:39.222Z"

settled_at
string<date-time> | null
required

Date when the transaction was settled. For provider transactions, this is derived from provider settlement data when available.

Example:

"2024-11-12T07:38:39.222Z"

refunded_at
string<date-time> | null
required

Date corresponding to the refund of the transaction.

Example:

null

last_refreshed_at
string<date-time> | null
required

Date corresponding to the last synchronization of the details with the payment provider.

Example:

null

provider_fee
object | null
required

Fee applied by the Payment Service Provider. Only supported for Stripe.

Example:

null

chargeback
object | null
required

Chargeback details related to the transaction.

Example:

null

integrations
object[]
required
payment_method_type
enum<string>
required
Available options:
card,
direct_debit,
direct_debit_ach,
direct_debit_bacs
payment_method
Card · object
required
status
enum<string>
required

Transaction status.

  • scheduled: The transaction is scheduled to be processed in the future.
  • to_process: The transaction is waiting to be processed by our system.
  • pending: The transaction has been authorized by the related payment processor, but the banking transaction is not yet settled.
  • settled: The transaction has been cleared on the banking side, the money transfer is fully completed.
  • cancelled: The transaction has been cancelled and won't be processed again.
Available options:
scheduled,
to_process,
pending,
settled,
cancelled
Example:

"settled"