Refund a transaction

Refunds a transaction with a specified ID.

The refund is in the same currency as the original transaction.

SecuritySecretApiKey or JWT
Request
path Parameters
id
required
string <= 50 characters ^[@~\-\.\w]+$

ID of the resource.

Request Body schema: application/json

Transaction resource.

amount
required
number <double>

Amount of the refund.

description
string <= 255 characters

Description of the refund.

isProcessedOutside
boolean
Default: false

Specifies if the refund is processed outside of Rebilly.

Responses
201

Transaction refunded.

Response Headers
Location
string <uri>

Location of the related resource.

Example: "https://api.rebilly.com/example"
Response Schema: application/json
id
string <= 50 characters

ID of the transaction.

websiteId
string <= 50 characters

ID of the website. A website is where an organization obtains a customer. For more information, see Obtain an organization ID and website ID.

customerId
string <= 50 characters

Customer resource ID.

type
string

Type of transaction.

Enum: "3ds-authentication" "authorize" "capture" "credit" "refund" "sale" "setup" "void"
status
string

Status of the transaction.

Enum: "completed" "conn-error" "disputed" "never-sent" "offsite" "partially-refunded" "pending" "refunded" "sending" "suspended" … 6 more
result
string

Result of the transaction.

Enum: "abandoned" "approved" "canceled" "declined" "unknown"
amount
number <double>

Total amount of the transaction.

currency
string = 3 characters

Currency code in ISO 4217 format.

purchaseAmount
number <double>

Amount by which the purchase is completed. If an adjustment occurs, the purchased amount may differ from the requested amount.

purchaseCurrency
string = 3 characters

Currency code in ISO 4217 format.

requestAmount
number <double>

Amount of the payment request. If an adjustment occurs, the purchase amount may differ from the billing amount.

requestCurrency
string = 3 characters

Currency code in ISO 4217 format.

parentTransactionId
string or null <= 50 characters

ID of the parent transaction.

childTransactions
Array of strings (ResourceId)

IDs of child transactions.

invoiceIds
Array of strings (ResourceId)

Related invoice IDs.

subscriptionIds
Array of strings (ResourceId)

Subscription IDs of invoices that are related to the transaction.

planIds
Array of strings (ResourceId)

Plan IDs of orders that are related to the transaction.

isRebill
boolean

Specifies if the transaction is one of a number of recurring payments in a subscription, excluding trials or setup fees.

rebillNumber
integer

Rebill number of the transaction. A rebill number is the number of recurring payments in a subscription, excluding trials or setup fees.

object

Billing address.

firstName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's first name.

lastName
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's last name.

organization
string or null <= 255 characters ^[\w\s\-\p{L},.'&]+$

Contact's organization.

address
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

First line of the contact's street address.

address2
string or null <= 60 characters ^[\w\s\-\/\p{L},.#;:()'&]+$

Second line of the contact's street address.

city
string or null <= 45 characters ^[\w\s\-\p{L},.']+$

Contact's city of residence.

region
string or null <= 45 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's region of residence.

country
string or null <= 2 characters ^[A-Z]{2}$

Contact's country of residence in ISO 3166 alpha-2 country code. For examples, see ISO.org.

postalCode
string or null <= 10 characters ^[\w\s\-]+$

Contact's postal code.

Array of objects (ContactPhoneNumbers)

List of phone numbers associated with the contact.

Array
label
required
string <= 45 characters

Phone number label or name.

value
required
string <= 50 characters

Phone number value.

primary
boolean

Specifies if the phone number is the contact's primary phone number.

Array of objects (ContactEmails)

List of email addresses associated with the contact.

Array
label
required
string <= 45 characters

Email label or name.

value
required
string <email> <= 255 characters

Email address value.

primary
boolean

Specifies if the email address is the contact's primary email address.

dob
string or null <date>

Contact's date of birth in ISO-8601 YYYY-MM-DD format.

jobTitle
string or null <= 255 characters ^[\w\s\-\/\p{L},.#;:()']+$

Contact's job title.

hash
string <= 40 characters

Use this value to compare contacts for identical attribute values.

has3ds
boolean

Specifies if the transaction uses 3D Secure.

object

Authentication object.

server
string

Name of the 3D Secure server.

version
string

Version of 3D Secure.

Enum: "1.0.2" "2.1.0" "2.2.0"
enrolled
string

Specifies if the cardholder is enrolled in 3D Secure.

Enum: "yes" "no" "invalid card/timeout" "unavailable"
authenticated
string

Authentication response status for 3D Secure.

Enum: "yes" "no" "not applicable" "attempted"
liability
string
Enum: "protected" "not protected" "protected (attempt)"
flow
string

Authentication flow for 3D Secure 2.

Enum: "frictionless" "challenge"
isDowngraded
boolean
Deprecated
Default: false

Specifies if 3D Secure 2 is attempted and downgraded to 3D Secure 1.

redirectUrl
string or null <uri>

URL where the end-user is redirected to when an offsite transaction is completed. The default value is the website URL.

retryNumber
integer

Position of the transaction in the sequence of retries.

isRetry
boolean

Specifies if a transaction is a retry.

billingDescriptor
string or null

Billing descriptor that appears on the periodic billing statement. For a credit card statement, this field commonly contains 12 or fewer characters.

description
string <= 255 characters

Description of the payment.

requestId
string

Request ID of the transaction. This ID must be unique within a 24 hour period. Use this field to prevent duplicated transactions.

hasAmountAdjustment
boolean

Specifies if the transaction has amount adjustment.

gatewayName
string or null

Name of the payment gateway that processed, or is selected to process, the transaction. This value is only available after a gateway is selected for the transaction.

Enum: "A1Gateway" "ACI" "Adyen" "Airpay" "AmazonPay" "AmexVPC" "ApcoPay" "AsiaPaymentGateway" "AstroPayCard" "AuthorizeNet" … 170 more
customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

processedTime
string <date-time>

Date and time when the transaction is processed.

createdTime
string <date-time> (CreatedTime)

Date and time which is set automatically when the resource is created.

updatedTime
string <date-time> (UpdatedTime)

Date and time which updates automatically when the resource is updated.

gatewayAccountId
string <= 50 characters

ID of the gateway account that processed the transaction.

gatewayTransactionId
string <= 50 characters

ID of the gateway transaction.

object

Related gateway information.

object

Gateway response.

code
string or null

Gateway response code.

message
string or null

Gateway response message.

type
string or null

Gateway response type.

originalCode
string or null

Raw, unmapped gateway response code.

originalMessage
string or null

Raw, unmapped gateway response message.

object

Gateway Address Verification System (AVS) response.

code
string or null

Response code.

message
string or null

Response message.

originalCode
string or null

Raw response code.

originalMessage
string or null

Raw response message.

object

Gateway Card Verification Value (CVV) response.

code
string or null

Response code.

message
string or null

Response message.

originalCode
string or null

Raw response code.

originalMessage
string or null

Raw response message.

acquirerName
string or null

Acquirer name. This value is only available when a transaction uses a payment gateway. If a transaction does not use a payment gateway, this value is null.

Enum: "Adyen" "ACI" "Alipay" "AIB" "Airpay" "AmazonPay" "ApcoPay" "AsiaPaymentGateway" "AstroPay Card" "Awepay" … 169 more
method
string
Deprecated

Payment method.

Note: Use paymentInstrument.method instead.

Enum: "payment-card" "ach" "cash" "check" "paypal" "AdvCash" "Airpay" "Alfa-click" "Alipay" "AmazonPay" … 165 more
velocity
integer

Number of transactions by the same customer in the past 24 hours.

revision
integer

Number of times the transaction data has been modified.

This revision number is useful when analyzing webhook data to determine if the change takes precedence over the current representation.

object or null

Transaction reference data.

property name*
additional property
string
bin
string <bin>

Payment card Bank Identification Number (BIN).

Vaulted instrument (object) or Alternative instrument (object) or Cash (object) or Check (object) (PaymentInstrumentValueObject)

Default payment instrument information.

Any of:

Vaulted payment instrument.

method
required
string

Payment method supported vault. For more information, see Payment instrument.

Enum: "payment-card" "ach" "cash" "check" "paypal" "AdvCash" "Airpay" "Alfa-click" "Alipay" "AmazonPay" … 165 more
paymentInstrumentId
required
string <= 50 characters

ID of the payment instrument.

hasDcc
boolean

Specifies if Dynamic Currency Conversion (DCC) applies to the transaction.

object or null

Detailed Dynamic currency conversion (DCC). If DCC is not applied to the transaction, this value is null.

object

Initial amount and currency to convert from.

amount
required
number <double> (MoneyAmount)
currency
required
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

object

Suggested amount and currency to convert to.

amount
required
number <double> (MoneyAmount)
currency
required
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

usdMarkup
number <double>

Markup amount converted to USD.

outcome
string

Dynamic currency conversion outcome.

Enum: "rejected" "selected" "unknown"
hasBumpOffer
boolean

Specifies if the transaction has a bump offer. A bump offer is a discount, purchase bonus, deal, that is offered to the customer during checkout.

object or null

Bump offer information. If the transaction does not have an associated bump offer, this value is null.

object

Initial amount and currency.

amount
required
number <double> (MoneyAmount)
currency
required
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

version
string

Name of the version selected. This field is useful to measure split tests.

language
string[a-zA-Z]{2}

Language in which the bump offer displays to the user. This field in useful to find translation issues.

outcome
string

Status of the bump offer.

Enum: "presented" "rejected" "selected" "unknown"
Array of objects or null (PurchaseBumpOffer) non-empty

Offers presented to a customer.

Array (non-empty)
offerId
required
string

ID of the bump offer.

offerType
required
string

Type of bump offer.

bumpAmount
required
number <double>

Amount of the bump offer.

bumpAmountInUsd
number <double>

Amount of the bump offer in USD.

customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

object or null

Offer selected by a customer. If a bump offer outcome is not selected, this value is null.

offerId
required
string

ID of the bump offer.

offerType
required
string

Type of bump offer.

bumpAmount
required
number <double>

Amount of the bump offer.

bumpAmountInUsd
number <double>

Amount of the bump offer in USD.

customFields
object (ResourceCustomFields)
Default: {}

Use custom fields to extend a resource scheme to include custom data that is not provided as a common field. For more information, see Custom fields.

riskScore
integer

Risk score for the transaction.

object or null (Risk metadata)

Risk metadata used for 3D Secure and risk scoring.

ipAddress
string or null <ipv4 or ipv6>

Customer's IP address.

fingerprint
string or null <= 50 characters

Customer's device fingerprint. A device fingerprint is a unique token that is used to identify the customer. The device fingerprint is generated based on device attributes, such as: hardware, software, IP address, language, browser, and more.

object or null

HTTP headers.

property name*
additional property
string
object or null

Browser data used for 3D Secure and risk scoring.

colorDepth
required
integer [ 1 .. 48 ]

Browser color depth in bits per pixel. This value is obtained using the screen.colorDepth property.

isJavaEnabled
required
boolean

Specifies if Java is enabled in a browser. This value is obtained from the navigator.javaEnabled property.

language
required
string <= 8 characters

Browser language settings. This value is obtained from the navigator.language property.

screenWidth
required
integer [ 0 .. 65535 ]

Width of the browser screen. This value is obtained from the screen.width property.

screenHeight
required
integer [ 0 .. 65535 ]

Height of the browser screen. This value is obtained from the screen.height property.

timeZoneOffset
required
integer [ -1410 .. 1410 ]

Browser time zone offset in minutes from UTC. A positive offset indicates that the local time is behind UTC. A negative offset indicates that the local time is ahead of UTC. You can find this value using the (new Date()).getTimezoneOffset() property.

object or null

Third-party data used for risk scoring.

kountFraudSessionId
string [ 10 .. 32 ]

Alpha-numeric fraudSessionId as provided by the Kount SDK.

payPalMerchantSessionId
string [ 1 .. 64 ]

PayPal MerchantSessionID as generated by the PayPal Fraudnet SDK.

threatMetrixSessionId
string [ 1 .. 128 ] [a-zA-Z0-9_-]+

Temporary identifier that is unique to the visitor's session and passed to ThreatMetrix.

isProxy
boolean

Specifies if the customer's IP address is related to a proxy.

isVpn
boolean

Specifies if the customer's IP address is related to a VPN.

isTor
boolean

Specifies if the customer's IP address is related to TOR.

isHosting
boolean

Specifies if the customer's IP address is related to hosting.

vpnServiceName
string or null

VPN service name, if available.

isp
string or null

Internet Service Provider (ISP) name, if available.

country
string or null <= 2 characters

Country ISO Alpha-2 code of the specified IP address.

region
string or null

Region of the specified IP address.

city
string or null

City of the specified IP address.

latitude
number <double>

Latitude of the specified IP address.

longitude
number or null <double>

Longitude of the specified IP address.

postalCode
string or null <= 10 characters

Postal code of the specified IP address.

timeZone
string or null

Time zone of the specified IP address.

accuracyRadius
integer or null

Accuracy radius of the specified IP address, in kilometers.

distance
integer or null

Distance between the customer's IP address and the billing address geolocation, in kilometers.

hasMismatchedBillingAddressCountry
boolean

Specifies if the customer's billing address country and geo-IP address are not the same.

hasMismatchedBankCountry
boolean

Specifies if the customer's bank country and geo-IP address are not the same.

hasMismatchedTimeZone
boolean

Specifies if the customer's browser time zone and the IP address associated time zone are not the same.

hasMismatchedHolderName
boolean

Specifies if the customer's billing address name and primary address name are not the same.

hasFakeName
boolean

Specifies if the holder name seems fake.

isHighRiskCountry
boolean

Specifies if the geo-IP country, or the customer's billing country, is considered a high risk country.

paymentInstrumentVelocity
integer

Number of transactions for this payment instrument, based on fingerprint, in the last 24 hours.

declinedPaymentInstrumentVelocity
integer

Number of declined transactions for this payment instrument fingerprint in the last 24 hours.

deviceVelocity
integer

Number of transactions for this device, based on fingerprint, in the last 24 hours.

ipVelocity
integer

Number of transactions for this IP address in the last 24 hours.

emailVelocity
integer

Number of transactions for this email address in the last 24 hours.

billingAddressVelocity
integer

Number of transactions for this billing address in the last 24 hours.

score
integer

Computed risk score based on all factors.

notificationUrl
string or null <uri>

URL where a server-to-server POST notification is sent. This notification is sent when the transaction result is finalized after a timeout or an offsite interaction.

Do not trust this notification alone, complete a GET request to confirm the result of the transaction. To ensure the request is not reattempted, when the result is confirmed, respond with a 2xx HTTP status code.

The following placeholders are available to use in this URI: {id} and {result}.

isDisputed
boolean

Specifies if a transaction is disputed.

disputeTime
string or null <date-time>

Date and time when the dispute is created. If the transaction is not disputed, this value is null.

disputeStatus
string or null

Status of the dispute.

Enum: null "response-needed" "under-review" "forfeited" "won" "lost" "unknown"
isReconciled
boolean

Specifies if the transaction is verified with gateway batch data.

isProcessedOutside
boolean

Specifies if the transaction is processed outside of Rebilly.

isMerchantInitiated
boolean

Specifies if the transaction is initiated by the merchant.

hadDiscrepancy
boolean

Specifies if the transaction is updated due to a discrepancy with its source of truth.

orderId
string
Deprecated

Order ID of the transaction. This ID must be unique within a 24 hour period.

Note: Use the requestId field instead.

arn
string or null

Acquirer reference number.

reportAmount
number <double>

Transaction amount converted to the report currency of the organization.

reportCurrency
string = 3 characters

Currency code in ISO 4217 format.

settlementTime
string or null <date-time>

Date and time when the transaction is settled by the banking institution.

discrepancyTime
string or null <date-time>

Date and time of the most recent discrepancy on the transaction.

object or null (LimitAmount)

Transaction amount limit information.

amount
number <double>

Limit amount.

currency
string (CurrencyCode) = 3 characters

Currency code in ISO 4217 format.

resetTime
string <date-time>

Date and time in which the limit amount resets. This value may be used for user interfaces.

organizationId
string <= 50 characters

Unique organization identifier. An organization is an entity that represents a company. For more information, see Obtain an organization ID.

Array of objects

Related links.

Array
href
string

Link URL.

rel
string

Type of link.

Enum: "self" "attachments" "website" "customer" "gatewayAccount" "paymentCard" "parentTransaction" "leadSource" "approvalUrl" "refundUrl" … 5 more
object

Embedded objects that are requested by the expand query parameter.

parentTransaction
object
childTransactions
Array of arrays <= 10 items

Most recent child transactions.

gatewayAccount
object
customer
object
leadSource
object
website
object
invoices
Array of arrays <= 10 items

Most recent related invoices.

paymentCard
object
bankAccount
object
401

Unauthorized access. Invalid credentials used.

403

Access forbidden.

404

Resource not found.

post/transactions/{id}/refund
Request samples
application/json
{
  • "amount": 0,
  • "description": "string",
  • "isProcessedOutside": false
}
Response samples
application/json
{
  • "id": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "websiteId": "web_0YV7DE4Z26DQSA1AC92FBJ7SEG",
  • "customerId": "cus_0YV7DDSDD1C8DA64KHH2W33CPF",
  • "type": "3ds-authentication",
  • "status": "completed",
  • "result": "abandoned",
  • "amount": 0,
  • "currency": "USD",
  • "purchaseAmount": 0,
  • "purchaseCurrency": "USD",
  • "requestAmount": 0,
  • "requestCurrency": "USD",
  • "parentTransactionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "childTransactions": [
    ],
  • "invoiceIds": [
    ],
  • "subscriptionIds": [
    ],
  • "planIds": [
    ],
  • "isRebill": true,
  • "rebillNumber": 0,
  • "billingAddress": {
    },
  • "has3ds": true,
  • "3ds": {
    },
  • "redirectUrl": "http://example.com",
  • "retryNumber": 0,
  • "isRetry": true,
  • "billingDescriptor": "string",
  • "description": "string",
  • "requestId": "string",
  • "hasAmountAdjustment": true,
  • "gatewayName": "A1Gateway",
  • "customFields": {
    },
  • "processedTime": "2019-08-24T14:15:22Z",
  • "createdTime": "2019-08-24T14:15:22Z",
  • "updatedTime": "2019-08-24T14:15:22Z",
  • "gatewayAccountId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "gatewayTransactionId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "gateway": {
    },
  • "acquirerName": "Adyen",
  • "method": "payment-card",
  • "velocity": 0,
  • "revision": 0,
  • "referenceData": {
    },
  • "bin": "string",
  • "paymentInstrument": {
    },
  • "hasDcc": true,
  • "dcc": {
    },
  • "hasBumpOffer": true,
  • "bumpOffer": {
    },
  • "riskScore": 0,
  • "riskMetadata": {
    },
  • "notificationUrl": "http://example.com",
  • "isDisputed": true,
  • "disputeTime": "2019-08-24T14:15:22Z",
  • "disputeStatus": null,
  • "isReconciled": true,
  • "isProcessedOutside": true,
  • "isMerchantInitiated": true,
  • "hadDiscrepancy": true,
  • "orderId": "string",
  • "arn": "74836950144358910018150",
  • "reportAmount": 0,
  • "reportCurrency": "USD",
  • "settlementTime": "2019-08-24T14:15:22Z",
  • "discrepancyTime": "2019-08-24T14:15:22Z",
  • "limits": {
    },
  • "organizationId": "4f6cf35x-2c4y-483z-a0a9-158621f77a21",
  • "_links": [
    ],
  • "_embedded": {
    }
}