{"componentChunkName":"component---src-templates-redoc-operation-js","path":"/customer-payment-profiles/tag/Data-definitions/schema/Card/","result":{"data":{"contentItem":{"type":"redoc-operation","link":"/customer-payment-profiles/tag/Data-definitions/schema/Card/","data":{"redocStoreStr":"{\"menu\":{\"activeItemIdx\":-1},\"definition\":{\"data\":{\"openapi\":\"3.0.3\",\"info\":{\"title\":\"Customers API\",\"description\":\"When you process payments using the Toast hosted checkout integration, you\\nuse the customers API to store information about customers, merchants, or partners that make those payments. You can store payment methods for\\ncustomers and use them for future payments.\\n\\nFor example, you might use the customers API to save or\\nretrieve information about a Toast platform restaurant guest (customer) who is making a\\npayment using the Toast hosted checkout integration on an online ordering\\nwebsite. If the customer chooses to save a payment method for future\\nuse, your integration can create a customer record for that customer using the\\ncustomers API. If the customer chooses to use a saved payment method, your\\nintegration can get information about that saved payment method using the\\ncustomers API. \\n\\n_Note_: the customers API and other components of the Toast\\nhosted checkout integration use the term _customer_ to mean a person or\\norganization making a payment (a payor). Toast platform restaurant APIs and\\nproducts use the term _guest_ to mean a person who visits a Toast platform\\nrestaurant or store. In Toast hosted checkout integration APIs, like the customers\\nAPI, using the term \\\"customer\\\" instead of the hospitality term \\\"guest\\\"\\nis better aligned with other, global payments processing infrastructure and\\nis more inclusive of transaction types handled by the Toast platform.\\n\",\"contact\":{\"name\":\"Toast developer support\"},\"version\":\"1.1.5\"},\"servers\":[{\"url\":\"https://toast-api-server\"}],\"paths\":{\"/v1/customers\":{\"post\":{\"summary\":\"Create a customer record\",\"description\":\"Creates a customer record with information about a person or organization\\nmaking Toast platform payments.\\n\",\"operationId\":\"createCustomer\",\"parameters\":[{\"name\":\"Toast-Restaurant-External-ID\",\"in\":\"header\",\"description\":\"The identifier of the location.  \\n\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"requestBody\":{\"content\":{\"*/*\":{\"schema\":{\"$ref\":\"#/components/schemas/CreateCustomerRequest\"}}}},\"responses\":{\"200\":{\"description\":\"Successful operation. Customer record created.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/CustomerResponse\"}}}},\"400\":{\"description\":\"The request to create a customer record was not correctly formed or\\ncould not be processed successfully.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"401\":{\"description\":\"Your client is not authorized to use the API endpoint.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"500\":{\"description\":\"Internal server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}}},\"security\":[{\"OAuth2\":[\"spi.customers:write\"]}]}},\"/v1/customers/{id}/payment-methods\":{\"get\":{\"summary\":\"Get a customer's payment methods\",\"description\":\"Returns a list of payment methods saved to a customer record.\\n\",\"operationId\":\"getCustomerPaymentMethods\",\"parameters\":[{\"name\":\"Toast-Restaurant-External-ID\",\"in\":\"header\",\"description\":\"The identifier of the location.  \\n\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"The unique identifier of the customer record.\\n\",\"required\":true,\"schema\":{\"type\":\"string\",\"format\":\"uuid\"}},{\"name\":\"Toast-Session-Secret\",\"in\":\"header\",\"description\":\"A unique and randomized identifier attached to a payment intent used to retrieve a customer's payment method data. \\n\",\"required\":false,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"description\":\"Successful operation. Returns information about a customer's saved payment methods. \\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/CustomerPaymentMethodsResponse\"},\"examples\":{\"responseBody\":{\"summary\":\"Get a list of payment methods\",\"value\":{\"results\":2,\"paymentMethods\":[{\"card\":{\"lastFour\":\"1111\",\"expiry\":{\"month\":\"12\",\"year\":\"27\"},\"type\":\"VISA\"}},{\"card\":{\"lastFour\":\"1111\",\"expiry\":{\"month\":\"12\",\"year\":\"27\"},\"type\":\"VISA\"}}]}}}}}},\"404\":{\"description\":\"The customer record does not exist.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"500\":{\"description\":\"Internal server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}}},\"security\":[{\"OAuth2\":[\"spi.customers:read\",\"simplified-payments-integration:read\"]}]}},\"/v1/customers/{id}/payment-methods/defaults\":{\"post\":{\"summary\":\"Set a default payment method for a customer\",\"description\":\"Sets a payment method as the customer's default payment method for a specific application context.\\n\",\"operationId\":\"setDefaultPaymentMethod\",\"parameters\":[{\"name\":\"Toast-Restaurant-External-ID\",\"in\":\"header\",\"description\":\"The identifier of the location.\\n\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"The unique identifier of the customer record.\\n\",\"required\":true,\"schema\":{\"type\":\"string\",\"format\":\"uuid\"}}],\"requestBody\":{\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/SetDefaultPaymentMethodRequest\"}}}},\"responses\":{\"200\":{\"description\":\"Successful operation. Payment method set as the default.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/DefaultPaymentMethodResponse\"}}}},\"400\":{\"description\":\"The request was not correctly formed or left empty.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"404\":{\"description\":\"The customer record does not exist, or the payment method was not found, or the payment method does not belong to the customer.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"500\":{\"description\":\"Internal server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}}},\"security\":[{\"OAuth2\":[\"simplified-payments-integration.server:write\"]}]}},\"/v1/customers/{id}/payment-methods/defaults/{contextName}\":{\"get\":{\"summary\":\"Get the default payment method for a customer\",\"description\":\"Returns the default payment method for a customer.\\n\",\"operationId\":\"getDefaultPaymentMethod\",\"parameters\":[{\"name\":\"Toast-Restaurant-External-ID\",\"in\":\"header\",\"description\":\"The identifier of the location.  \\n\",\"required\":true,\"schema\":{\"type\":\"string\",\"format\":\"string\"}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"The unique identifier of the customer record.\\n\",\"required\":true,\"schema\":{\"type\":\"string\",\"format\":\"uuid\"}},{\"name\":\"Toast-Session-Secret\",\"in\":\"header\",\"description\":\"A unique and randomized identifier attached to a payment intent used to retrieve a customer's payment method data. \\n\",\"required\":false,\"schema\":{\"type\":\"string\"}},{\"name\":\"contextName\",\"in\":\"path\",\"description\":\"The unique integration provided context name for the default payment method.\\n\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"description\":\"Successful operation. Returns information about a customer's default payment method.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/DefaultPaymentMethodResponse\"}}}},\"404\":{\"description\":\"The customer record does not exist.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"500\":{\"description\":\"Internal server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}}},\"security\":[{\"OAuth2\":[\"spi.customers:read\",\"simplified-payments-integration:read\"]}]},\"delete\":{\"summary\":\"Delete the default payment method for a customer\",\"description\":\"Deletes a customer's default payment method.\\n\",\"operationId\":\"deleteDefaultPaymentMethod\",\"parameters\":[{\"name\":\"Toast-Restaurant-External-ID\",\"in\":\"header\",\"description\":\"The identifier of the location.\\n\",\"required\":true,\"schema\":{\"type\":\"string\"}},{\"name\":\"id\",\"in\":\"path\",\"description\":\"The unique identifier of the customer record.\\n\",\"required\":true,\"schema\":{\"type\":\"string\",\"format\":\"uuid\"}},{\"name\":\"contextName\",\"in\":\"path\",\"description\":\"The unique integration provided context name that the default payment method should be deleted for.\\n\",\"required\":true,\"schema\":{\"type\":\"string\"}}],\"responses\":{\"200\":{\"description\":\"Successful operation. Default payment method deleted. \\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/DefaultPaymentMethodResponse\"}}}},\"404\":{\"description\":\"The customer record does not exist, or no default payment method is set for the context name.\\n\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"500\":{\"description\":\"Internal server error.\",\"content\":{\"application/json\":{\"schema\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}}},\"security\":[{\"OAuth2\":[\"simplified-payments-integration.server:write\"]}]}}},\"components\":{\"schemas\":{\"CustomerResponse\":{\"type\":\"object\",\"description\":\"Response to create a customer record. \\n\",\"properties\":{\"id\":{\"type\":\"string\",\"description\":\"The unique identifier for the customer record that can be used to create a payment intent. This identifies the customer in the Toast platform and allows them to choose from saved payment methods associated with their record.\",\"format\":\"uuid\"},\"externalReferenceId\":{\"type\":\"string\",\"description\":\"The unique identifier for the customer in your integration.\"},\"description\":{\"type\":\"string\",\"description\":\"A brief description of the customer, such as an email address, name, or phone number.\"}}},\"ErrorMessage\":{\"type\":\"object\",\"description\":\"An object that contains information about one or more errors that the\\nToast platform encountered when processing your API request. For more\\ninformation, see [API responses and errors in the _Toast Developer\\nGuide_](https://doc.toasttab.com/doc/devguide/apiResponsesAndErrors.html).\\n\",\"properties\":{\"status\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"The HTTP status code of the response.\\n\"},\"code\":{\"type\":\"integer\",\"format\":\"int32\",\"description\":\"A numeric identifier for the error condition.\\n\"},\"message\":{\"type\":\"string\",\"description\":\"A description of the error condition.\\n\"},\"messageKey\":{\"type\":\"string\",\"description\":\"Reserved for future use.\\n\"},\"fieldName\":{\"type\":\"string\",\"description\":\"Reserved for future use.\\n\"},\"link\":{\"type\":\"string\",\"description\":\"Reserved for future use. \\n\"},\"requestId\":{\"type\":\"string\",\"description\":\"The unique identifier of the HTTP request that your client sent to\\nthe Toast API.\\n\"},\"developerMessage\":{\"type\":\"string\",\"description\":\"Additional detail about the error condition, if it is available.\\n\"},\"errors\":{\"type\":\"array\",\"description\":\"A JSON array of `ErrorMessage` objects.\\n\",\"items\":{\"$ref\":\"#/components/schemas/ErrorMessage\"}}}},\"CreateCustomerRequest\":{\"type\":\"object\",\"description\":\"Request to create a customer record. \\n\",\"properties\":{\"externalReferenceId\":{\"type\":\"string\",\"description\":\"Represents the customer's identity in your integration. This can be the primary key for your customer, a unique UUID, an email address, or any other value.\"},\"description\":{\"type\":\"string\",\"description\":\"A brief description of the customer, such as an email address, name, or phone number.\"}}},\"CustomerPaymentMethodsResponse\":{\"type\":\"object\",\"description\":\"Response to retrieve customer payment methods. The response holds information about the stored payment methods for a customer. \\n\",\"properties\":{\"results\":{\"description\":\"The number of payment methods attached to a customer record. \\nThis is the size of the `paymentMethods` array.\\n\",\"type\":\"integer\",\"format\":\"int32\"},\"paymentMethods\":{\"description\":\"An array of `PaymentMethodData` objects that provide information\\nabout saved payment methods for a customer.\\n\",\"type\":\"array\",\"items\":{\"$ref\":\"#/components/schemas/PaymentMethodData\"}}}},\"PaymentMethodData\":{\"type\":\"object\",\"description\":\"Details about a payment method.\\n\",\"properties\":{\"id\":{\"description\":\"The unique identifier of the saved payment method. \\n\",\"type\":\"string\"},\"type\":{\"description\":\"The type of saved payment method. \\n\",\"type\":\"string\"},\"cardType\":{\"description\":\"The payment card brand. For example, AMEX™, Discover™, Mastercard™, or Visa™.\\n\",\"type\":\"string\",\"enum\":[\"Visa\",\"Mastercard\",\"Amex\",\"Discover\",\"JCB\",\"Diners\",\"Citi\",\"Maestro\",\"Laser\",\"Solo\",\"Interac\",\"Eftpos\",\"Unknown\"]},\"lastFour\":{\"description\":\"The last four digits of the payment card.\\n\",\"type\":\"string\"},\"month\":{\"description\":\"The expiration month of the payment card. \\n\",\"type\":\"string\"},\"year\":{\"description\":\"The expiration year of the payment card.\\n\",\"type\":\"string\"},\"card\":{\"$ref\":\"#/components/schemas/Card\"}}},\"SetDefaultPaymentMethodRequest\":{\"type\":\"object\",\"description\":\"Request to set a payment method as the default for a customer.\\n\",\"required\":[\"paymentMethodId\",\"contextName\"],\"properties\":{\"paymentMethodId\":{\"type\":\"string\",\"description\":\"The unique identifier of the payment method.\\n\",\"format\":\"uuid\"},\"contextName\":{\"type\":\"string\",\"description\":\"The unique integration provided context name that the payment method should be set as the default for.\\n\"}}},\"DefaultPaymentMethodResponse\":{\"type\":\"object\",\"description\":\"Response to set a default payment method.\\n\",\"properties\":{\"paymentMethodId\":{\"type\":\"string\",\"format\":\"uuid\",\"description\":\"The unique identifier of the payment method.\\n\"},\"contextName\":{\"type\":\"string\",\"description\":\"The unique integration provided context name that identifies the application context for the payment method.  For example, \\\"NYC bakery checkout\\\" or \\\"SF subscription\\\".\\n\"}}},\"Card\":{\"type\":\"object\",\"description\":\"The payment card details associated with the payment method.\\n\",\"properties\":{\"lastFour\":{\"type\":\"string\",\"description\":\"The last four digits of the payment card.\\n\"},\"expiry\":{\"$ref\":\"#/components/schemas/Expiry\"},\"type\":{\"type\":\"string\",\"description\":\"The payment card brand.\\n\"}}},\"Expiry\":{\"type\":\"object\",\"description\":\"The expiration month and year of the payment card.\\n\",\"properties\":{\"month\":{\"type\":\"string\",\"description\":\"The expiration month of the payment card.\\n\"},\"year\":{\"type\":\"string\",\"description\":\"The expiration year of the payment card.\\n\"}}}},\"securitySchemes\":{\"OAuth2\":{\"type\":\"oauth2\",\"flows\":{\"clientCredentials\":{\"tokenUrl\":\"https://toast-api-server/authentication/v1/authentication/login\",\"scopes\":{\"spi.customers:read\":\"Allows retrieving customer information\",\"spi.customers:write\":\"Allows creating customer records\"}}}}}}}},\"options\":{\"hideTryItPanel\":true,\"pagination\":\"item\",\"generateCodeSamples\":{\"languages\":[{\"lang\":\"curl\"},{\"lang\":\"Java\"},{\"lang\":\"Python\"},{\"lang\":\"Node.js\"},{\"lang\":\"C#\"}]},\"showConsole\":false,\"hideHostname\":true,\"hideDownloadButton\":true,\"sortPropsAlphabetically\":true,\"schemaDefinitionsTagName\":\"Data definitions\",\"disableSearch\":true,\"ctrlFHijack\":false,\"disableSidebar\":true,\"theme\":{\"overrides\":{\"DownloadButton\":{\"custom\":\"\"},\"NextSectionButton\":{\"custom\":\"\"}},\"codeBlock\":{\"tokens\":{}},\"schema\":{\"constraints\":{},\"examples\":{}},\"rightPanel\":{\"textColor\":\"#eeeeee\"},\"typography\":{\"heading1\":{},\"heading2\":{},\"heading3\":{},\"rightPanelHeading\":{}}}}}","redocHasSecurityDefinitions":false,"redocInfoPageLink":"/customer-payment-profiles/overview/","redocItemId":"tag/Data-definitions/schema/Card","redocHasInfoPage":false,"settings":{"generateCodeSamples":{"languages":[{"lang":"curl"},{"lang":"Java"},{"lang":"Python"},{"lang":"Node.js"},{"lang":"C#"}]},"showConsole":false,"hideHostname":true,"hideDownloadButton":true,"sortPropsAlphabetically":true,"schemaDefinitionsTagName":"Data definitions","hideTryItPanel":true},"requestLogin":false,"lastModified":"2024-07-26T19:07:18.000Z"},"seo":{"title":"Card"}}},"pageContext":{"id":"9d18bc46-f1f9-53c5-ba64-13482b3df6eftag/Data-definitions/schema/Card/__redocly content/customer-payment-profiles/tag/Data-definitions/schema/Card/","seo":{"title":"Card","description":"<SchemaDefinition showWriteOnly={true} schemaRef=\"#/components/schemas/Card\" />","image":"","keywords":null,"jsonLd":null,"lang":null},"pageId":"customer-payment-profiles.reference.page.yaml#tag/Data-definitions/schema/Card/","pageBaseUrl":"/customer-payment-profiles","type":"redoc-operation","toc":{"enable":true,"maxDepth":4,"headings":null},"data":{},"catalogInfo":null,"link":"/customer-payment-profiles/tag/Data-definitions/schema/Card/","sidebarName":"api-reference","isLanding":false,"showPrevButton":null,"showNextButton":null,"apiVersions":[{"definitionId":"customerPaymentProfiles","id":"customerPaymentProfiles","title":"customerPaymentProfiles","isDefault":true,"apiId":null}],"apiVersionId":null,"isDefaultApiVersion":true}},"staticQueryHashes":["1123603147","1180902673","1302185487","1344209882","1398840060","1520077861","1975142765","2667623876","2950305614","3743992808","561138138"]}