Account updater
Buyers - Payment methods
Payment methods
Payment methods - Payment service tokens
Payment methods - Network tokens
Buyers - Gift cards
Buyers - Shipping details
Card scheme definitions
Digital wallets - Setup
Digital wallets - Sessions
Transactions
Refunds
Payment options
Payment service definitions
Payment services
Audit logs
Checkout sessions
Merchant accounts
Payment methods - Payment service tokens
Create payment service token
Create a gateway tokens for a payment method.
POST
/
payment-methods
/
{payment_method_id}
/
payment-service-tokens
curl --request POST \
--url https://api.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_service_id": "fffd152a-9532-4087-9a4f-de58754210f0",
"redirect_url": "https://example.com/callback"
}'
{
"type": "payment-service-token",
"id": "07e70d14-a0c0-4ff5-bd4a-509959af0e4d",
"approval_url": "https://gr4vy.app/redirect/12345",
"payment_method_id": "ef9496d8-53a5-4aad-8ca2-00eb68334389",
"payment_service_id": "fffd152a-9532-4087-9a4f-de58754210f0",
"status": "succeeded",
"token": "pm_12345",
"created_at": "2013-07-16T19:23:00.000+00:00",
"updated_at": "2013-07-16T19:23:00.000+00:00"
}
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.
Examples:
"default"
Path Parameters
The ID of the payment method
Examples:
"ef9496d8-53a5-4aad-8ca2-00eb68334389"
Body
application/json
Response
201
application/json
Successful Response
The response is of type object
.
Was this page helpful?
curl --request POST \
--url https://api.{id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"payment_service_id": "fffd152a-9532-4087-9a4f-de58754210f0",
"redirect_url": "https://example.com/callback"
}'
{
"type": "payment-service-token",
"id": "07e70d14-a0c0-4ff5-bd4a-509959af0e4d",
"approval_url": "https://gr4vy.app/redirect/12345",
"payment_method_id": "ef9496d8-53a5-4aad-8ca2-00eb68334389",
"payment_service_id": "fffd152a-9532-4087-9a4f-de58754210f0",
"status": "succeeded",
"token": "pm_12345",
"created_at": "2013-07-16T19:23:00.000+00:00",
"updated_at": "2013-07-16T19:23:00.000+00:00"
}
Assistant
Responses are generated using AI and may contain mistakes.