Creates a card payment intent. It lasts 24 hours and allows at most 5 charge attempts.
POSThttps://api.gravv.xyz/v1/collections/cards/payment-intentsTry it
Api-Key
Creates a card payment intent. It lasts 24 hours and allows at most 5 charge attempts.
Without card_token, the response has a payment_link for the payer. With card_token, Gravv charges the saved card at once. The response is then HTTP 200 whatever the outcome, so check data.status.
Headers
NameDescription
Idempotency-Key:stringRequired
Required for POST requests. Reuse it only to retry the same request. Gravv stores a 400 with the key for 24 hours, so use a new key after you fix a rejected body.
X-Device-Id:string
Optional ID of the payer's device. On a payment intent, Gravv stores it and reuses it for later saved-card charges.
Body parameters
NameDescription
customer_id:stringRequired
Your Gravv customer. The customer record must have a phone number and a date of birth.
client_customer_id:stringRequired
Your reference for the customer. Saved cards are looked up by this value, so use the same one every time.
amount:stringRequired
USD amount in major units, as a string with at most 2 decimal places.
currency:stringRequired
country:string
Alpha-2 country code, stored on the intent. Card availability still uses the customer's address country.
client_reference:string
Your reference. It must be unique across your collections and payment intents.
card_token:string
A saved card token from GET /v1/collections/cards. When you send it, Gravv charges the card at once.
save_card:boolean
When true, asks the checkout to save the card
Defaultfalse
redirect_url:string
Where to send the payer after checkout. Gravv adds payment_intent_id and client_reference to it.
asset:string
Stablecoin to settle in. If you leave it out, USD settles as USDC.
network:string
Settlement network. If you send it, it must match the destination.
Possible values: polygon, ethereum, base, stellar, solana, avalanche
metadata:object
Your own data, returned in webhooks for this collection. At most 50 keys. The keys provider_response, internal_transaction_id and system_metadata are reserved. For bank_transfer, put the payer's bank account number in bank_account_number.
Show 1 child attributesobject
bank_account_number:string
The payer's bank account number, for bank_transfer
destination:oneOfRequired
One of the following variants:
Show 5 child attributesoneOf
destination_type:stringRequired
Type of internal destination
Possible values: internal_account, internal_crypto_wallet
id:stringRequired
An account ID for internal_account, or a wallet ID for internal_crypto_wallet
destination_type:stringRequired
Possible values: external_crypto_wallet
wallet_address:stringRequired
Address of the external wallet. Gravv checks only its length, so check that the address is on network. Funds sent to a wrong address are lost.
network:stringRequired
Settlement network
Possible values: polygon, ethereum, base, stellar, solana, avalanche
source:objectRequired
Show 2 child attributesobject
source_type:stringRequired
Possible values: external
methods:string[]Required
Possible values: card
Response
Returns 200 OK. The payment intent
NameDescription
data:object
Show 16 child attributesobject
intent_id:string
Payment intent ID. Send it as payment_intent_id to charge a card.
status:string
created when you send no card token. With a card token, it is processing when the charge went through, requires_action for 3D Secure, or charge_failed with the reason in message.
Possible values: created, processing, requires_action, charge_failed
client_reference:string
amount:string
currency:string
created_at:string
expires_at:string
24 hours after created_at
metadata:object
payment_link:string
Checkout link, returned when you send no card token. It carries a secret for this payment, so send it only to the payer.
client_secret:string
Sent only when Gravv could not build a payment link
payment_key:string
Sent only when Gravv could not build a payment link
transaction_id:string
The collection's transaction_id, when a card token charge went through
message:string
Outcome of a card token charge
requires_action:boolean
next_action_type:string
Possible values: redirect_to_url
next_action_url:string
The 3D Secure page to send the payer to
error:null
Errors
Status
Meaning
200
The payment intent
400
The request failed. Every collections error is a 400, including not-found. Read error.