POST
/
payment-methods
/
{payment_method_id}
/
payment-service-tokens
curl --request POST \
  --url https://api.{gr4vy_id}.gr4vy.app/payment-methods/{payment_method_id}/payment-service-tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "payment_service_id": "a7d6b829-aea5-407d-ab7f-138784b5ad2c",
  "redirect_url": "https://example.com/callback"
}'
{
  "type": "payment-service-token",
  "id": "d6ad71d5-6908-45d6-ab65-39c55475dd08",
  "payment_method_id": "9bdc4bc4-005e-4658-8eee-a309fc43cd4d",
  "payment_service_id": "50f2e61f-caac-4e12-8d79-30eaf8250423",
  "status": "succeeded",
  "approval_url": "https://api.example.app.gr4vy.com/payment-methods/f4fb0dd1-4ff9-46fb-965e-11de34aa6806/approve",
  "token": "<string>",
  "created_at": "2021-01-01T12:34:00.000+00:00",
  "updated_at": "2021-01-01T12:34:00.000+00:00"
}

This endpoint requires the payment-methods.write scope.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

payment_method_id
string
required

The ID of the payment method.

Example:

"46973e9d-88a7-44a6-abfe-be4ff0134ff4"

Body

application/json

Request body for provision a payment service token.

Response

201
application/json
Returns the created payment service token.

A payment service token.