---
title: "POST /setup-method/s2s/create"
method: POST
path: "/setup-method/s2s/create"
---

# POST /setup-method/s2s/create

`POST /setup-method/s2s/create`

Create a new setup method for storing payment methods server to server

## Headers

- `Idempotency-Key` string

## Request body

- CreateS2sSetupMethod
  - `currency` string, required — Three letter abbreviation of the currency. Refer [supported currencies](/get-started/currencies-supported)
  - `customerId` string — The unique identifier for the customer, generated via the [create-customer API](/developer-resources/endpoints/customer/create-customer). This can be used to associate the payment with a specific customer in your system.
  - `customerReferenceId` string — Your unique identifier for the customer. This can be used to associate the payment with a specific customer in your system.
  - `billingDetails` BillingDetails, required — Billing details for the customer.
    - `name` string, required — Customer's name
    - `email` string, required — Customer's email address
    - `contactNumber` string, required — Customer's contact number ([E.164 format](https://en.wikipedia.org/wiki/E.164)), including the country code (e.g., +1 for US, +44 for UK, +91 for India).
    - `customerAddress` CustomerAddress
      - `addressLine1` string — Line 1 of the customer's address
      - `addressLine2` string — Line 2 of the customer's address
      - `city` string — City of the customer's address
      - `state` string — State of the customer's address
      - `country` string — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)).
      - `postalCode` string — Postal code
  - `storeFrontId` string — The unique identifier for your storefront
  - `callbackUrl` string, required — The URL we will callback to once the setup is complete
  - `phoneNumberRequired` boolean — Flag to indicate whether phone number is required from the customer during checkout. By default, this is false.
  - `cardDetails` CardDetails, required — Payment card information collected by you
    - `cardHolderName` string — Name of the cardholder
    - `cardNumber` string, required — Full Primary Account Number (PAN)
    - `expiryMonth` integer, required — Card expiry month in MM format
    - `expiryYear` integer, required — Card expiry year in YY format
    - `cvv` string, required — Card security code (CVV/CSC).
    - `country` string — Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)) of the country where the card is registered.
    - `postalCode` string — Postal code of the location where the card is registered.
  - `amount` integer — The amount to charge immediately while setting up the payment method token. The amount in lowest count unit e.g.: For USD 1, amount is 100 representing 100 cents. Should be greater than 0.
  - `receiptId` string — Your identifier of the order. This will be persisted in the intent created while setting up the payment method token.
  - `metadata` object — A collection of key-value pairs that can be attached to an object for storing additional structured information. Constraints: - Maximum of 50 key-value pairs allowed. - Each key must be no longer than 40 characters. - Each value must be a string and cannot exceed 500 characters.

## Response `200`

Setup Method created successfully

- CreateSetupMethodResponse
  - `setupMethodId` string — Unique identifier of the setup method
  - `fwdUrl` string — The URL to redirect the customer to complete the setup

## Other responses

- `400` — Invalid request

---

[API](https://skmtc.net/xpaycheckout/apis/xpay-api-store.md) · [All operations](https://skmtc.net/xpaycheckout/apis/xpay-api-store/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/xpaycheckout/xpay-api-store/versions/6329a7c694bc/schema)
