{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/sidebars.yaml","api-docs-apis/openapi.yaml":"api-docs-apis/openapi.yaml"},"props":{"metadata":{"markdoc":{"tagList":["replay-openapi","openapi-response-sample"]},"type":"markdown"},"seo":{"title":"Reefpay Docs","description":"Reefpay is the groundbreaking payment gateway that lets you integrate with the future of payments."},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"accept-a-card-payment","__idx":0},"children":["Accept a card payment"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A sale authorizes the card and captures the funds in a single request. Use it"," ","when you deliver at the moment of payment — a digital download, a subscription"," ","charge, a service that completes right away."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["If you ship later, ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/authorize-and-capture"},"children":["authorize now and capture when you ship"]}," ","instead."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"before-you-start","__idx":1},"children":["Before you start"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Your ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Api-Key"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Client-Id"]}," — see ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/get-started/authentication"},"children":["Authentication"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["A processor integration configured for cards"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"send-the-sale","__idx":2},"children":["Send the sale"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v1/transactions"]}," with ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}," set to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SALE"]},"."]},{"$$mdtype":"Tag","name":"ReplayOpenApi","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"createTransaction","exampleKey":"saleWithCard","parameters":{},"options":{},"environments":{}},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The fields that decide whether this works:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Field"},"children":["Field"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Notes"},"children":["Notes"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SALE"]},". A card also accepts ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["AUTH"]},". It does ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["not"]}," accept ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["PAYOUT"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["amount"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Integer, smallest currency unit. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["10000"]}," is 100.00 USD. Minimum ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["50"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.type"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Card"]},", spelled exactly that way. Mixed case, not ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["CARD"]}]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.pan"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["14 to 19 digits"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.expiry"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["An object of two ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["integers"]},": ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["month"]}," 1–12, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["year"]}," four digits"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.cvv"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["3 or 4 digits. Optional, but send it when the cardholder is present"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.billing_address"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Drives AVS. Optional, and worth sending"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["currency"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["USD"]}," is the only accepted value, and the default"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Two mistakes are easy to make here."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["expiry"]}," is nested, and its parts are integers."]}," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"month\": 1"]},", not"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["\"expiry_month\": \"01\""]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["The name fields are ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["first_name"]}," and ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["last_name"]}]},", inside ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method"]},"."," ","There is no ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["cardholder_name"]},"."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"read-the-response","__idx":3},"children":["Read the response"]},{"$$mdtype":"Tag","name":"OpenApiResponseSample","attributes":{"descriptionFile":"api-docs-apis/openapi.yaml","operationId":"createTransaction","exampleKey":"saleWithCard","responseSamplesResolved":[{"lang":"json","title":"200 application/json","source":"{\n  \"id\": \"TRANSACTION-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"reference_transaction_id\": null,\n  \"type\": \"SALE\",\n  \"result\": \"APPROVED\",\n  \"client_id\": \"CLIENT-01KFDKXMQ637EKEAY410MSQSXB\",\n  \"client_dba\": \"Acme Jewelry\",\n  \"integrations\": [\n    \"TSYS\"\n  ],\n  \"response_code\": \"00\",\n  \"response_description\": \"Approved\",\n  \"batch_id\": \"BATCH-01KEW32V6YNV11T33XGDR7TGWC\",\n  \"is_settled\": false,\n  \"time_created\": \"2026-07-15T14:22:05Z\",\n  \"amount\": 10000,\n  \"tip\": 0,\n  \"currency\": \"USD\",\n  \"payment_method\": {\n    \"type\": \"CARD\",\n    \"truncated_pan\": \"****-****-****-5439\",\n    \"payment_token\": \"PAYMENT_TOKEN-01KFDKXMQ637EKEAY410MSQSXB\",\n    \"expiry\": {\n      \"month\": \"01\",\n      \"year\": \"2028\"\n    },\n    \"first_name\": \"John\",\n    \"last_name\": \"Doe\",\n    \"entry_method\": \"keyed\",\n    \"auth_code\": \"123456\",\n    \"retrieval_reference_number\": \"000000603076\",\n    \"card_type\": \"UNKNOWN\",\n    \"card_brand\": \"Visa\",\n    \"cvv_result_code\": \"M\",\n    \"avs_result_code\": \"Y\",\n    \"avs_response\": \"Exact Match - Street address and postal code match\"\n  },\n  \"initiator\": \"CUSTOMER\",\n  \"network_transaction_id\": \"MCC1234567890\",\n  \"metadata\": {\n    \"order_id\": \"ORD-10432\",\n    \"sales_channel\": \"web\",\n    \"customer_reference\": \"cust-8891\"\n  }\n}"},{"lang":"json","title":"400 application/json","source":"{\n  \"error_code\": \"INVALID_REQUEST_DATA\",\n  \"error_message\": \"The API request contains invalid data.\",\n  \"details\": {\n    \"amount\": \"Invalid amount\",\n    \"payment_method.pan\": \"Malformed PAN\"\n  },\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"13\",\n    \"message\": \"Invalid amount\"\n  }\n}"},{"lang":"json","title":"401 application/json","source":"{\n  \"error_code\": \"NOT_AUTHENTICATED\",\n  \"error_message\": \"Access credentials missing or invalid.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"403 application/json","source":"{\n  \"error_code\": \"UNAUTHORIZED_ACTION\",\n  \"error_message\": \"Requested action is unavailable or forbidden.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": null,\n    \"code\": null,\n    \"message\": null\n  }\n}"},{"lang":"json","title":"409 application/json","source":"{\n  \"error_code\": \"DUPLICATE_ACTION\",\n  \"error_message\": \"Duplicate action requested.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"12\",\n    \"message\": \"Invalid transaction\"\n  }\n}"},{"lang":"json","title":"500 application/json","source":"{\n  \"error_code\": \"SYSTEM_ERROR\",\n  \"error_message\": \"Internal system error.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"TSYS\",\n    \"code\": \"96\",\n    \"message\": \"System malfunction\"\n  }\n}"},{"lang":"json","title":"502 application/json","source":"{\n  \"error_code\": \"DOWNSTREAM_ERROR\",\n  \"error_message\": \"Downstream service returned invalid or unexpected response.\",\n  \"details\": null,\n  \"source\": {\n    \"system\": \"VERICHECK\",\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["result"]}," first. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["APPROVED"]}," means the money is yours at the next batch"," ","close; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["DECLINED"]}," means the issuer said no; ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["ERROR"]}," means the transaction could"," ","not be attempted. All three come back as ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["200"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["A few fields deserve attention."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.payment_token"]}]}," is a token for this card, issued as a side"," ","effect of the transaction. Store it and you never need the number again. See"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/save-and-reuse-a-payment-method"},"children":["Save and reuse a payment method"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.avs_result_code"]}]}," says how much of the billing address"," ","matched. ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Y"]}," is a full match, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["Z"]}," postal code only, ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["N"]}," neither. See"," ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/concepts/avs-and-cvv"},"children":["AVS and CVV"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payment_method.card_type"]}," is always ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["UNKNOWN"]}," here."]}," The processor does not"," ","report it on an authorization. Read the transaction back from"," ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/transactions/{id}"]}," for the real value."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["batch_id"]}]}," is the settlement batch. It is null until the transaction"," ","reaches one."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":4},"children":["Next steps"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/authorize-and-capture"},"children":["Authorize and capture separately"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/save-and-reuse-a-payment-method"},"children":["Save and reuse a payment method"]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/payments/handle-declines"},"children":["Handle declines"]}]}]}]},"headings":[{"value":"Accept a card payment","id":"accept-a-card-payment","depth":1},{"value":"Before you start","id":"before-you-start","depth":2},{"value":"Send the sale","id":"send-the-sale","depth":2},{"value":"Read the response","id":"read-the-response","depth":2},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Accept a card payment","shortTitle":"Card payment","intro":"Charge a card in one call. A sale authorizes and captures together, which is what you want when you fulfill immediately.","type":"how-to","seo":{"title":""}},"lastModified":"2026-09-17T08:54:39.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/payments/accept-a-card-payment","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}