---
title: Create Payment Card wallet
slug: docs/demo/create-payment-card-wallet
description: Learn how to make a successful POST request to the /REST/api/accounts/{accountReference}/payment-details/card endpoint of a fictive API with this handy code example. This document includes the essential headers and payload parameters required for creating
docTags: 
createdAt: 2022-03-21T20:12:45.000Z
---

{
  "id": "7l-tQF1-HpAI--4iMbJrq",
  "data": {
    "url": "https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/card",
    "name": "Create Payment Card wallet",
    "method": "POST",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "accountReference",
          "type": "string"
        }
      ],
      "queryParameters": [],
      "headerParameters": [
        {
          "kind": "optional",
          "name": "X-TokenId",
          "type": "string",
          "description": "The eSuite Token Id"
        },
        {
          "kind": "optional",
          "name": "X-SessionId",
          "type": "string",
          "description": "The eSuite Session Id"
        },
        {
          "kind": "required",
          "name": "X-Version",
          "type": "string",
          "description": "The eSuite Version"
        },
        {
          "kind": "optional",
          "name": "Origin",
          "type": "string",
          "description": "The eSuite Origin"
        }
      ],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "paymentDetailsCard",
          "type": "object",
          "schema": [
            {
              "kind": "optional",
              "name": "cardNumber",
              "type": "string",
              "example": "",
              "description": "Card number"
            },
            {
              "kind": "optional",
              "name": "cardType",
              "type": "string",
              "example": "",
              "description": "Card type"
            },
            {
              "kind": "optional",
              "name": "expiryDate",
              "type": "string",
              "example": "",
              "description": "Expiry date"
            },
            {
              "kind": "optional",
              "name": "issueCode",
              "type": "string",
              "example": "",
              "description": "Issue code"
            },
            {
              "kind": "optional",
              "name": "cvv",
              "type": "string",
              "example": "",
              "description": "CVV"
            },
            {
              "kind": "optional",
              "name": "billingHouseName",
              "type": "string",
              "example": "",
              "description": "Billing house name"
            },
            {
              "kind": "optional",
              "name": "billingHouseFlatNumber",
              "type": "string",
              "example": "",
              "description": "Billing house flat number"
            },
            {
              "kind": "optional",
              "name": "billingStreet",
              "type": "string",
              "example": "",
              "description": "Billing street"
            },
            {
              "kind": "optional",
              "name": "billingDistrict",
              "type": "string",
              "example": "",
              "description": "Billing district"
            },
            {
              "kind": "optional",
              "name": "billingTownCity",
              "type": "string",
              "example": "",
              "description": "Billing town city"
            },
            {
              "kind": "optional",
              "name": "billingCounty",
              "type": "string",
              "example": "",
              "description": "Billing county"
            },
            {
              "kind": "optional",
              "name": "billingPostcode",
              "type": "string",
              "example": "",
              "description": "Billing postcode"
            },
            {
              "kind": "optional",
              "name": "billingCountry",
              "type": "string",
              "example": "",
              "description": "Billing country"
            },
            {
              "kind": "optional",
              "name": "setDefault",
              "type": "boolean",
              "example": "",
              "description": "Set default"
            },
            {
              "kind": "optional",
              "name": "associatedName",
              "type": "string",
              "example": "",
              "description": "Associated name"
            },
            {
              "kind": "optional",
              "name": "skipPreAuth",
              "type": "boolean",
              "example": "",
              "description": "Skip pre authentication"
            },
            {
              "kind": "optional",
              "name": "customPaymentParameters",
              "type": "object",
              "schema": [],
              "example": {},
              "description": "Custom Payment Parameters"
            }
          ],
          "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetailsCard",
          "customType": "FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetailsCard",
          "isExpanded": true,
          "description": "Payment details card"
        }
      ],
      "formDataParameters": []
    },
    "responses": [
      {
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "schema": [
              {
                "kind": "optional",
                "name": "cards",
                "type": "array",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "associatedName",
                    "type": "string",
                    "example": "",
                    "description": "Associated name"
                  },
                  {
                    "kind": "optional",
                    "name": "billingHouseName",
                    "type": "string",
                    "example": "",
                    "description": "Billing house name"
                  },
                  {
                    "kind": "optional",
                    "name": "billingHouseFlatNumber",
                    "type": "string",
                    "example": "",
                    "description": "Billing house flat number"
                  },
                  {
                    "kind": "optional",
                    "name": "billingStreet",
                    "type": "string",
                    "example": "",
                    "description": "Billing street"
                  },
                  {
                    "kind": "optional",
                    "name": "billingDistrict",
                    "type": "string",
                    "example": "",
                    "description": "Billing district"
                  },
                  {
                    "kind": "optional",
                    "name": "billingTownCity",
                    "type": "string",
                    "example": "",
                    "description": "Billing town city"
                  },
                  {
                    "kind": "optional",
                    "name": "billingCounty",
                    "type": "string",
                    "example": "",
                    "description": "Billing county"
                  },
                  {
                    "kind": "optional",
                    "name": "billingPostcode",
                    "type": "string",
                    "example": "",
                    "description": "Billing postcode"
                  },
                  {
                    "kind": "optional",
                    "name": "billingCountry",
                    "type": "string",
                    "example": "",
                    "description": "Billing country"
                  },
                  {
                    "kind": "optional",
                    "name": "cardNumber",
                    "type": "string",
                    "example": "",
                    "description": "Card number"
                  },
                  {
                    "kind": "optional",
                    "name": "cardType",
                    "type": "string",
                    "example": "",
                    "description": "Card type"
                  },
                  {
                    "kind": "optional",
                    "name": "expiryDate",
                    "type": "string",
                    "example": "",
                    "description": "Expiry date"
                  },
                  {
                    "kind": "optional",
                    "name": "isDefault",
                    "type": "boolean",
                    "example": "",
                    "description": "Is default"
                  },
                  {
                    "kind": "optional",
                    "name": "issueCode",
                    "type": "string",
                    "example": "",
                    "description": "Issue code"
                  },
                  {
                    "kind": "optional",
                    "name": "paymentDetailId",
                    "type": "string",
                    "example": "",
                    "description": "Payment account id"
                  },
                  {
                    "kind": "optional",
                    "name": "authorised",
                    "type": "boolean",
                    "example": "",
                    "description": "Value that determins if the card has been validated"
                  },
                  {
                    "kind": "optional",
                    "name": "paymentAccountParameters",
                    "type": "object",
                    "schema": [],
                    "example": {},
                    "description": "PaymentAccountParameter dictionary for wallet"
                  },
                  {
                    "kind": "optional",
                    "name": "bin",
                    "type": "string",
                    "example": "",
                    "description": "BIN"
                  },
                  {
                    "kind": "optional",
                    "name": "pan",
                    "type": "string",
                    "example": "",
                    "description": "PAN (CardReference)"
                  },
                  {
                    "kind": "optional",
                    "name": "creationDate",
                    "type": "string<date-time>",
                    "example": "",
                    "description": "CreationDate"
                  },
                  {
                    "kind": "optional",
                    "name": "cardCategory",
                    "type": "string",
                    "example": "",
                    "description": "CardCategory (Debit/Credit)"
                  },
                  {
                    "kind": "optional",
                    "name": "issuer",
                    "type": "string",
                    "example": "",
                    "description": "Issuer"
                  },
                  {
                    "kind": "optional",
                    "name": "cardPurpose",
                    "type": "string",
                    "example": "",
                    "description": "CardPurpose (Business/...)"
                  },
                  {
                    "kind": "optional",
                    "name": "issuingCountry",
                    "type": "string",
                    "example": "",
                    "description": "IssuingCountry"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.PaymentDetailsCardSummary",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v3.PaymentDetailsCardSummary[]",
                "description": "Gets or sets the payment details cards."
              },
              {
                "kind": "optional",
                "name": "payPal",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "paymentDetailId",
                    "type": "string",
                    "example": "",
                    "description": "Payment details id"
                  },
                  {
                    "kind": "optional",
                    "name": "billingAgreementId",
                    "type": "string",
                    "example": "",
                    "description": "BillingAgreementId"
                  },
                  {
                    "kind": "optional",
                    "name": "payPalPayerId",
                    "type": "string",
                    "example": "",
                    "description": "PayPalPayerId"
                  },
                  {
                    "kind": "optional",
                    "name": "accountCountry",
                    "type": "string",
                    "example": "",
                    "description": "AccountCountry"
                  },
                  {
                    "kind": "optional",
                    "name": "accountEmail",
                    "type": "string",
                    "example": "",
                    "description": "AccountEmail"
                  },
                  {
                    "kind": "optional",
                    "name": "accountStatus",
                    "type": "string",
                    "example": "",
                    "description": "AccountStatus"
                  },
                  {
                    "kind": "optional",
                    "name": "billingAgreementDate",
                    "type": "string<date-time>",
                    "example": "",
                    "description": "BillingAgreementDate"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.PaymentDetailsPayPal",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.PaymentDetailsPayPal",
                "description": "Gets or sets the PayPal account info."
              },
              {
                "kind": "optional",
                "name": "bacs",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "accountHolderName",
                    "type": "string",
                    "example": "",
                    "description": "The account holder name."
                  },
                  {
                    "kind": "optional",
                    "name": "accountNumber",
                    "type": "string",
                    "example": "",
                    "description": "The account number."
                  },
                  {
                    "kind": "optional",
                    "name": "sortCode",
                    "type": "string",
                    "example": "",
                    "description": "The account sort code."
                  },
                  {
                    "kind": "optional",
                    "name": "bacsReference",
                    "type": "string",
                    "example": "",
                    "description": "The bacs mandate reference."
                  },
                  {
                    "kind": "optional",
                    "name": "serviceReference",
                    "type": "string",
                    "example": "",
                    "description": "The service id."
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.BacsDirectDebitPaymentDetails",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.BacsDirectDebitPaymentDetails",
                "description": "Gets or sets the bacs direct debit payment details."
              },
              {
                "kind": "optional",
                "name": "sepa",
                "type": "object",
                "schema": [
                  {
                    "kind": "optional",
                    "name": "accountHolderName",
                    "type": "string",
                    "example": "",
                    "description": "Account holder name."
                  },
                  {
                    "kind": "optional",
                    "name": "iban",
                    "type": "string",
                    "example": "",
                    "description": "The IBAN."
                  },
                  {
                    "kind": "optional",
                    "name": "bic",
                    "type": "string",
                    "example": "",
                    "description": "The BIC."
                  },
                  {
                    "kind": "optional",
                    "name": "serviceReference",
                    "type": "string",
                    "example": "",
                    "description": "The service id."
                  },
                  {
                    "kind": "optional",
                    "name": "mandateReference",
                    "type": "string",
                    "example": "",
                    "description": "The mandate reference."
                  },
                  {
                    "kind": "optional",
                    "name": "bankCountry",
                    "type": "string",
                    "example": "",
                    "description": "BankCountry"
                  },
                  {
                    "kind": "optional",
                    "name": "sepaMandateCreationDate",
                    "type": "string<date-time>",
                    "example": "",
                    "description": "SEPAMandateCreationDate"
                  }
                ],
                "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.SepaDirectDebitPaymentDetails",
                "customType": "FictiveGlobal.Api.Rest.Dtos.v2.PaymentDetails.SepaDirectDebitPaymentDetails",
                "description": "Gets or sets the sepa direct debit payment details."
              }
            ],
            "modelRef": "#/definitions/FictiveGlobal.Api.Rest.Dtos.v3.PaymentDetails.PaymentAccountDetails",
            "customType": "FictiveGlobal.Api.Rest.Dtos.v3.PaymentDetails.PaymentAccountDetails",
            "isExpanded": true,
            "description": "Payment account details"
          }
        ],
        "isExpanded": true,
        "statusCode": "201",
        "description": "Created",
        "jsonExample": "{\n  \"cards\": [\n    {\n      \"associatedName\": \"Joe Bloggs\",\n      \"billingHouseName\": \"Joe\",\n      \"billingHouseFlatNumber\": \"100\",\n      \"billingStreet\": \"Wigan\",\n      \"billingDistrict\": \"Manchester\",\n      \"billingTownCity\": \"Bolton\",\n      \"billingCounty\": \"Manchester\",\n      \"billingPostcode\": \"111111\",\n      \"billingCountry\": \"United Kindom\",\n      \"cardNumber\": \"4111111111111111\",\n      \"cardType\": \"visa\",\n      \"expiryDate\": \"01/20\",\n      \"isDefault\": true,\n      \"issueCode\": \"123\",\n      \"paymentDetailId\": \"21871\",\n      \"authorised\": false,\n      \"paymentAccountParameters\": {\n        \"ParameterName\": \"ParameterValue\",\n        \"ParameterName2\": \"ParameterValue2\"\n      },\n      \"bin\": \"111111\",\n      \"pan\": \"001PDDOFCDUXEZXIZ1\",\n      \"creationDate\": \"0001-01-01T00:00:00\",\n      \"cardCategory\": \"Debit\",\n      \"issuer\": \"Bank of Ireland\",\n      \"cardPurpose\": \"Business\"\n    }\n  ],\n  \"payPal\": {\n    \"paymentDetailId\": \"1000\",\n    \"billingAgreementId\": \"123425\",\n    \"payPalPayerId\": \"123425\",\n    \"accountCountry\": \"GB\",\n    \"accountEmail\": \"email@email.com\",\n    \"accountStatus\": \"verified\",\n    \"billingAgreementDate\": \"0001-01-01T00:00:00\"\n  },\n  \"bacs\": {\n    \"accountHolderName\": \"Fictive Global Solutions\",\n    \"accountNumber\": \"*****111\",\n    \"sortCode\": \"00-00-00\",\n    \"bacsReference\": \"171717\",\n    \"serviceReference\": \"0010CNM41Q96TNTZM1\"\n  },\n  \"sepa\": {\n    \"accountHolderName\": \"Fictive Global Solutions\",\n    \"iban\": \"********************0100\",\n    \"bic\": \"DEUTDEFF\",\n    \"serviceReference\": \"0010CNM41Q96TNTZM1\",\n    \"mandateReference\": \"SPECSAVERS\",\n    \"bankCountry\": \"GB\",\n    \"sepaMandateCreationDate\": \"0001-01-01T00:00:00\"\n  }\n}"
      },
      {
        "isExpanded": true,
        "statusCode": "400",
        "description": "Unable to authenticate using the provided session",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "401",
        "description": "Not Authorized",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "404",
        "description": "Account Does Not Exist",
        "jsonExample": ""
      },
      {
        "isExpanded": true,
        "statusCode": "500",
        "description": "Internal Server Error",
        "jsonExample": ""
      }
    ],
    "contentType": "application/json",
    "description": "This endpoint will provide the ability to add a new payment card (credit or debit) onto the eSuite platform",
    "examples": {
      "languages": [
        {
          "id": "q9BKlnmbN0EQl0FD7bk9o",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/card \\\n     --header 'accept: application/json' \\\n     --header 'x-version: string'"
        },
        {
          "id": "AsPXho7NB2t2hwpklJCLJ",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"x-version\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/card\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "CJJfGY-rslYffYcpmLL33",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/card\")\n\nhttps = Net::HTTP.new(url.host, url.port)\nhttps.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest[\"accept\"] = \"application/json\"\nrequest[\"content-type\"] = \"application/json\"\nrequest[\"x-version\"] = \"string\"\n\nresponse = https.request(request)\nputs response.read_body\n"
        },
        {
          "id": "CGQIj2J_bBMkkRs48icm2",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"https://api.fictive.com/REST/api/accounts/{accountReference}/payment-details/card\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'x-version': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "q9BKlnmbN0EQl0FD7bk9o"
    },
    "results": {
      "languages": [
        {
          "id": "response-0-201",
          "language": "201",
          "code": "{\n  \"cards\": [\n    {\n      \"associatedName\": \"Joe Bloggs\",\n      \"billingHouseName\": \"Joe\",\n      \"billingHouseFlatNumber\": \"100\",\n      \"billingStreet\": \"Wigan\",\n      \"billingDistrict\": \"Manchester\",\n      \"billingTownCity\": \"Bolton\",\n      \"billingCounty\": \"Manchester\",\n      \"billingPostcode\": \"111111\",\n      \"billingCountry\": \"United Kindom\",\n      \"cardNumber\": \"4111111111111111\",\n      \"cardType\": \"visa\",\n      \"expiryDate\": \"01/20\",\n      \"isDefault\": true,\n      \"issueCode\": \"123\",\n      \"paymentDetailId\": \"21871\",\n      \"authorised\": false,\n      \"paymentAccountParameters\": {\n        \"ParameterName\": \"ParameterValue\",\n        \"ParameterName2\": \"ParameterValue2\"\n      },\n      \"bin\": \"111111\",\n      \"pan\": \"001PDDOFCDUXEZXIZ1\",\n      \"creationDate\": \"0001-01-01T00:00:00\",\n      \"cardCategory\": \"Debit\",\n      \"issuer\": \"Bank of Ireland\",\n      \"cardPurpose\": \"Business\"\n    }\n  ],\n  \"payPal\": {\n    \"paymentDetailId\": \"1000\",\n    \"billingAgreementId\": \"123425\",\n    \"payPalPayerId\": \"123425\",\n    \"accountCountry\": \"GB\",\n    \"accountEmail\": \"email@email.com\",\n    \"accountStatus\": \"verified\",\n    \"billingAgreementDate\": \"0001-01-01T00:00:00\"\n  },\n  \"bacs\": {\n    \"accountHolderName\": \"Fictive Global Solutions\",\n    \"accountNumber\": \"*****111\",\n    \"sortCode\": \"00-00-00\",\n    \"bacsReference\": \"171717\",\n    \"serviceReference\": \"0010CNM41Q96TNTZM1\"\n  },\n  \"sepa\": {\n    \"accountHolderName\": \"Fictive Global Solutions\",\n    \"iban\": \"********************0100\",\n    \"bic\": \"DEUTDEFF\",\n    \"serviceReference\": \"0010CNM41Q96TNTZM1\",\n    \"mandateReference\": \"SPECSAVERS\",\n    \"bankCountry\": \"GB\",\n    \"sepaMandateCreationDate\": \"0001-01-01T00:00:00\"\n  }\n}"
        },
        {
          "id": "response-1-400",
          "language": "400",
          "code": "// Unable to authenticate using the provided session\n"
        },
        {
          "id": "response-2-401",
          "language": "401",
          "code": "// Not Authorized\n"
        },
        {
          "id": "response-3-404",
          "language": "404",
          "code": "// Account Does Not Exist\n"
        },
        {
          "id": "response-4-500",
          "language": "500",
          "code": "// Internal Server Error\n"
        }
      ],
      "selectedLanguageId": "response-0-201"
    }
  },
  "type": "api-oas-v2",
  "children": [
    {
      "text": ""
    }
  ]
}