POST
/
payment-methods
curl --request POST \
  --url https://api.{gr4vy_id}.gr4vy.app/payment-methods \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "method": "card",
  "number": "4111111111111111",
  "expiration_date": "11/25",
  "redirect_url": "https://example.com/callback"
}'
{
  "type": "payment-method",
  "id": "77a76f7e-d2de-4bbc-ada9-d6a0015e6bd5",
  "additional_schemes": [
    "visa"
  ],
  "approval_target": "any",
  "approval_url": "https://api.example.app.gr4vy.com/payment-methods/ffc88ec9-e1ee-45ba-993d-b5902c3b2a8c/approve",
  "buyer": {
    "type": "buyer",
    "id": "fe26475d-ec3e-4884-9553-f7356683f7f9",
    "billing_details": {
      "type": "billing-details",
      "first_name": "John",
      "last_name": "Lunn",
      "email_address": "john@example.com",
      "phone_number": "+1234567890",
      "address": {
        "city": "London",
        "country": "GB",
        "postal_code": "789123",
        "state": "Greater London",
        "state_code": "GB-LND",
        "house_number_or_name": "10",
        "line1": "10 Oxford Street",
        "line2": "New Oxford Court",
        "organization": "Gr4vy"
      },
      "tax_id": {
        "value": "12345678931",
        "kind": "gb.vat"
      }
    },
    "created_at": "2013-07-16T19:23:00.000+00:00",
    "display_name": "John L.",
    "external_identifier": "user-789123",
    "merchant_account_id": "default",
    "updated_at": "2013-07-16T19:23:00.000+00:00",
    "account_number": "1234567"
  },
  "country": "US",
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "currency": "USD",
  "details": {
    "bin": "412345",
    "card_type": "credit",
    "card_issuer_name": "Bank"
  },
  "expiration_date": "07/24",
  "external_identifier": "user-789123",
  "has_replacement": false,
  "label": "john@example.com",
  "last_replaced_at": "2023-07-26T19:23:00.000+00:00",
  "merchant_account_id": "default",
  "method": "card",
  "mode": "card",
  "scheme": "visa",
  "status": "succeeded",
  "updated_at": "2013-07-16T19:23:00.000+00:00",
  "fingerprint": "20eb353620155d2b5fc864cc46a73ea77cb92c725238650839da1813fa987a17",
  "last_used_at": "2013-07-16T19:23:00.000+00:00",
  "usage_count": 5,
  "cit_last_used_at": "2013-07-16T19:23:00.000+00:00",
  "cit_usage_count": 2
}

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.

Body

application/json

Details to register a new card payment method.

Response

201
application/json
Returns the created payment method.

A generic payment method.