transactions.write
scope.Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
The ID of the merchant account to use for this request.
"default"
A unique key that identifies this request. Providing this header will make this an idempotent request. We recommend using V4 UUIDs, or another random string with enough entropy to avoid collisions.
"request-12345"
The IP address to forward from the customer. Use this when calling our API from the server side to ensure the customer's address is passed to downstream services, rather than your server IP.
"192.168.0.2"
Body
The monetary amount for this transaction, in the smallest currency unit for the given currency, for example 1299
cents to create an authorization for $12.99
. If the intent
is set to capture
, an amount greater than zero must be supplied. All gift card amounts are subtracted from this amount before the remainder is charged to the provided payment_method
.
0 <= x <= 99999999
1299
A supported ISO 4217 currency code. For redirect requests, this value must match the one specified for currency
in payment_method
.
"EUR"
"GBP"
"MXN"
The 2-letter ISO code of the country where the transaction is processed. This is also used to filter the payment services that can process the transaction. If this value is provided for redirect requests and it's not null
, it must match the one specified for country
in payment_method
. Otherwise, the value specified for country
in payment_method
will be assumed implicitly.
"DE"
"GB"
"US"
The optional payment method to use for this transaction. This field is required if no gift_cards
have been added.
Create a transaction with raw card details
Guest buyer details provided inline rather than creating a buyer resource beforehand and using the buyer_id
or buyer_external_identifier
keys. No buyer resource will be created on Gr4vy when used.
The ID of the buyer to associate this payment method to. If this field is provided then the buyer_external_identifier
field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field.
"fe26475d-ec3e-4884-9553-f7356683f7f9"
The external_identifier
of the buyer to associate this payment method to. If this field is provided then the buyer_id
field needs to be unset. If a stored payment method or gift card is provided, then the buyer for that payment method needs to match the buyer for this field.
1 - 200
"buyer-12345"
An external identifier that can be used to match the transaction against your own records.
1 - 200
"transaction-12345"
Defines the intent of this API call. This determines the desired initial state of the transaction.
authorize
- (Default) Optionally approves and then authorizes a transaction but does not capture the funds.capture
- Optionally approves and then authorizes and captures the funds of the transaction.
authorize
, capture
Whether or not to also try and store the payment method with us so that it can be used again for future use. This is only supported for payment methods that support this feature. There are also a few restrictions on how the flag may be set:
- The flag has to be set to
true
when thepayment_source
is set torecurring
orinstallment
, andmerchant_initiated
is set tofalse
. - The flag has to be set to
false
(or not set) when using a previously vaulted payment method.
true
Pass through 3-D Secure data to support external 3-D Secure authorisation. If using an external 3-D Secure provider, you should not pass a redirect_url
in the payment_method
object for a transaction.
Any additional information about the transaction that you would like to store as key-value pairs. This data is passed to payment service providers that support it.
{
"cohort": "cohort-12345",
"order": "order-12345"
}
Indicates whether the transaction represents a subsequent payment coming from a setup recurring payment. Please note there are some restrictions on how this flag may be used.
The flag can only be false
(or not set) when the transaction meets one of the following criteria:
- It is not
merchant_initiated
. payment_source
is set tocard_on_file
.
The flag can only be set to true
when the transaction meets one of the following criteria:
- It is not
merchant_initiated
. payment_source
is set torecurring
orinstallment
andmerchant_initiated
is set totrue
.payment_source
is set tocard_on_file
.
true
Indicates whether the transaction was initiated by the merchant (true) or customer (false).
true
The use-case for the the transaction.
ecommerce
, moto
, recurring
, installment
, card_on_file
An array of cart items that represents the line items of a transaction.
A scheme's transaction identifier to use in connecting a merchant initiated transaction to a previous customer initiated transaction. If not provided, and a qualifying customer initiated transaction has been previously made with the stored payment method, then Gr4vy will populate this value with the identifier returned for that transaction. This field is also know as the Visa Transaction Identifier, or Mastercard Trace ID.
1 - 100
"123456789012345"
Information about the browser used by the buyer. This can be used by anti-fraud services. Merchant provided browser info
The unique identifier of a set of shipping details stored for the buyer. If provided, the created transaction will include a copy of the details at the point of transaction creation; i.e. it will not be affected by later changes to the detail in the database.
"bf8c36ad-02d9-4904-b0f9-a230b149e341"
Whether to capture the transaction asynchronously.
- When
async_capture
isfalse
(default), the transaction is captured in the same request. - When
async_capture
istrue
, the transaction is automatically captured at a later time.
Redirect transactions are not affected by this flag. This flag can only be set to true
when intent
is set to capture
.
true
This field represents the fingerprint data to be passed to the active anti-fraud service.
"yGeBAFYgFmM="
The unique identifier of an existing payment service. When provided, the created transaction will be processed by the given payment service and any routing rules will be skipped.
"fffd152a-9532-4087-9a4f-de58754210f0"
Marks the transaction as an AFT. Requires the payment service to support this feature, and might recipient
and buyer
data
true
Defines if the transaction will allow for a partial authorization.
The recipient of any account to account funding. For use with AFTs. Recipient of an account funding transaction
The number of installments a buyer is required to make.
1 <= x <= 100
Response
Returns the created transaction.
A full transaction resource.
The ID for the transaction.
"7099948d-7286-47e4-aad8-b68f7eb44591"
The base62 encoded transaction ID. This represents a shorter version of this transaction's id
which is sent to payment services, anti-fraud services, and other connectors. You can use this ID to reconcile a payment service's transaction against our system. This ID is sent instead of the transaction ID because not all services support 36 digit identifiers.
"default"
The ID of the merchant account this transaction belongs to.
"default"
The currency code for this transaction.
"EUR"
"GBP"
"MXN"
The total amount for this transaction across all funding sources including gift cards.
1299
The status of the transaction for the payment_method
. The status may change over time as asynchronous processing events occur.
processing
, authorization_succeeded
, authorization_declined
, authorization_failed
, authorization_voided
, authorization_void_pending
, capture_succeeded
, capture_pending
, buyer_approval_pending
The amount for this transaction that has been authorized for the payment_method
. This can be less than the amount
if gift cards were used.
1299
The total amount captured for this transaction, in the smallest currency unit (for example, cents or pence). This can be the full value of the authorized_amount
or less.
1299
The total amount refunded for this transaction, in the smallest currency unit (for example, cents or pence). This can be the full value of the captured_amount
or less.
1299
The original intent
used when the transaction was created.
authorize
, capture
The date and time when the transaction was created, in ISO 8601 format.
"2013-07-16T19:23:00.000+00:00"
The date and time when the transaction was last updated, in ISO 8601 format.
"2013-07-16T19:23:00.000+00:00"
The source of the transaction.
ecommerce
, moto
, recurring
, installment
, card_on_file
Indicates whether the transaction was initiated by the merchant or the customer.
true
Indicates whether the transaction represents a subsequent payment or an initial one.
false
The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. capture
or authorize
) has been achieved when dealing with multiple payment instruments.
pending
, succeeded
, failed
The outcome of the original intent of a transaction. This allows you to understand if the intent of the transaction (e.g. capture
or authorize
) has been achieved when dealing with multiple payment instruments.
true
Always transaction
.
"transaction"
"transaction"
The 2-letter ISO 3166-1 alpha-2 country code for the transaction. Used to filter payment services for processing.
"DE"
"GB"
"US"
An external identifier that can be used to match the transaction against your own records.
1 - 200
"transaction-12345"
The payment method used for this transaction.
The method used for the transaction.
card
, oxxo
, spei
, pse
, tapi
"card"
The name of the instrument used to process the transaction.
pan
, card_token
, redirect
, redirect_token
, googlepay
, applepay
, network_token
"pan"
The standardized error code set by Gr4vy.
"missing_redirect_url"
The payment service used for this transaction.
Whether a manual anti fraud review is pending with an anti fraud service.
false
The buyer used for this transaction.
This is the response code received from the payment service. This can be set to any value and is not standardized across different payment services.
"E104"
This is the response description received from the payment service. This can be set to any value and is not standardized across different payment services.
"Missing redirect URL"
The shipping details associated with the transaction.
The identifier for the checkout session this transaction is associated with.
"4137b1cf-39ac-42a8-bad6-1c680d5dab6b"
This is the response description received from the processor.
"00"
The response code received from the payment service for the Address Verification Check (AVS). This code is mapped to a standardized Gr4vy AVS response code.
match
, no_match
, partial_match_address
, partial_match_postcode
, unavailable
"match"
The response code received from the payment service for the Card Verification Value (CVV). This code is mapped to a standardized Gr4vy CVV response code.
match
, no_match
, unavailable
, not_provided
"match"
The mapped decision received from the anti-fraud service. In case of a review decision this field is not updated once the review is resolved.
accept
, error
, exception
, reject
, review
, skipped
"accept"
An array of cart items that represents the line items of a transaction.
An identifier for the transaction used by the scheme itself, when available.
"123456789012345"
The 3-D Secure data that was sent to the payment service for the transaction.
The payment service's unique ID for the transaction.
"tx-12345"
A list of additional identifiers that we may keep track of to manage this transaction. This may include the authorization ID, capture ID, and processor ID, as well as an undefined list of additional identifiers.
{
"payment_service_authorization_id": "auth-12345",
"payment_service_capture_id": "capture-12345"
}
Additional information about the transaction stored as key-value pairs.
{
"cohort": "cohort-12345",
"order": "order-12345"
}
The date this transaction was authorized at.
"2013-07-16T19:23:00.000+00:00"
The date this transaction was captured at.
"2013-07-16T19:23:00.000+00:00"
The date this transaction was voided at.
"2013-07-16T19:23:00.000+00:00"
The date this transaction's approval URL will expire at.
"2013-07-16T19:23:00.000+00:00"
The date this transaction's approval timed out at.
"2013-07-16T19:23:00.000+00:00"
An optional merchant advice code which provides insight into the type of transaction or reason why the payment failed.
"02"
"21"
The number of installments for this transaction, if applicable.
3