Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Collections Create payment intent

Create payment intent

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
destination:oneOfRequired
One of the following variants:
Show 5 child attributesoneOf
source:objectRequired
Show 2 child attributesobject

Response

Returns 200 OK. The payment intent

NameDescription
data:object
Show 16 child attributesobject
error:null

Errors

StatusMeaning
200The payment intent
400The request failed. Every collections error is a 400, including not-found. Read error.
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/collections/cards/payment-intents' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: order_789_attempt_1' \
--header 'X-Device-Id: device-7f3a9c' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "f827e428-c497-4b21-8855-99d978909c28",
"client_customer_id": "merchant-user-123",
"amount": "3.50",
"currency": "USD",
"client_reference": "order-abc-123",
"save_card": true,
"destination": {
"destination_type": "internal_crypto_wallet",
"id": "b628ff35-429b-48f7-bcf0-6a49df106fc6"
},
"source": {
"source_type": "external",
"methods": [
"card"
]
},
"metadata": {
"order_id": "ord_123"
}
}'
Responseapplication/json
200400OK
{
"data": {
"intent_id": "pi_429f578b-675a-4b68-abe3-856cd976257f",
"client_reference": "order-abc-123",
"status": "created",
"amount": "3.50",
"currency": "USD",
"created_at": "2026-10-12T10:00:00Z",
"expires_at": "2026-10-13T10:00:00Z",
"metadata": {
"order_id": "ord_123"
},
"payment_link": "https://checkout.example.com/pi_429f578b-675a-4b68-abe3-856cd976257f?session=eyJqd3QiOiIuLi4ifQ=="
},
"error": null
}