POST
/
payment-services
using Gr4vy;
using Gr4vy.Models.Components;
using System.Collections.Generic;

var sdk = new Gr4vySDK(
    id: "example",
    server: SDKConfig.Server.Sandbox,
    bearerAuthSource: Auth.WithToken(privateKey),
    merchantAccountId: "default"
);

var res = await sdk.PaymentServices.CreateAsync(paymentServiceCreate: new PaymentServiceCreate() {
    DisplayName = "Stripe",
    PaymentServiceDefinitionId = "stripe-card",
    Fields = new List<Field>() {
        new Field() {
            Key = "api_key",
            Value = "key-12345",
        },
    },
    AcceptedCurrencies = new List<string>() {
        "USD",
        "EUR",
        "GBP",
    },
    AcceptedCountries = new List<string>() {
        "US",
        "DE",
        "GB",
    },
    ThreeDSecureEnabled = true,
    SettlementReportingEnabled = true,
});

// handle response
{
  "type": "payment-service",
  "id": "fffd152a-9532-4087-9a4f-de58754210f0",
  "merchant_account_id": "default",
  "payment_service_definition_id": "stripe-card",
  "active": true,
  "method": "card",
  "display_name": "Stripe",
  "position": 1,
  "status": "created",
  "accepted_currencies": [
    "USD",
    "EUR",
    "GBP"
  ],
  "accepted_countries": [
    "US",
    "DE",
    "GB"
  ],
  "payment_method_tokenization_enabled": true,
  "network_tokens_enabled": true,
  "open_loop": true,
  "settlement_reporting_enabled": true,
  "three_d_secure_enabled": true,
  "merchant_profile": {},
  "webhook_url": "<string>",
  "fields": [
    {
      "key": "api_key",
      "value": "key-12345"
    }
  ],
  "reporting_fields": [
    {
      "key": "api_key",
      "value": "key-12345"
    }
  ],
  "is_deleted": false,
  "created_at": "2013-07-16T19:23:00.000+00:00",
  "updated_at": "2013-07-16T19:23:00.000+00:00"
}

This endpoint requires the payment-services.write scope.

Authorizations

Authorization
string
header
required

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

Headers

x-gr4vy-merchant-account-id
string | null

The ID of the merchant account to use for this request.

Examples:

"default"

Body

application/json

Request body for activating a payment service

Response

201
application/json

Successful Response

The response is of type object.