# Accept Bit payments Building with an AI agent? Start at https://docs.payme.io/agents.md ## Prerequisites - The seller's seller_payme_id (MPL) - The Bit service active on the seller's account - A public HTTPS URL for sale_callback_url ## Related - [Create a sale (hosted payment page)](/payments/hosted-payment-page/post-generate-sale) - [Let the buyer choose how to pay](/accepting-payments/checkout-and-in-person/let-the-buyer-choose) - [Enable payment methods and services for your sellers](/marketplaces-and-platforms/seller-onboarding/enable-services) - [Callbacks](/payments/getting-started/callbacks) - [Errors](/payments/getting-started/errors) - [Refund a sale](/payments/post-sale-actions/post-refund-sale) - [List sales](/payments/query-apis/post-get-sales) Bit is an Israeli payment app. The buyer approves the payment in the Bit app on their phone, then PayMe completes the charge and sends you the result. Bit runs on PayMe's payment page: create a sale with `sale_payment_method: bit` to offer Bit alone, or with `multi` to offer it next to cards and wallets. Limits: - **ILS only.** Create Bit sales with `currency: ILS`. - **One payment.** A `bit` sale with more than one installment fails with error `351`. On a `multi` page where the buyer chooses the number of installments, a buyer who pays with Bit pays in one payment. - **No saved payment method.** `capture_buyer` with `bit` returns error `4`, and a `multi` page with `capture_buyer` doesn't offer Bit. - **Payment page only.** The browser SDK has no Bit method. ## Enable Bit - **A seller** installs Bit from the dashboard app store (חנות אפליקציות). It is active as soon as it is installed. - **A partner** turns Bit on for its seller with `vas-enable`, sending your partner key, the seller's MPL and your partner account's Bit service ID as `vas_payme_id`: ```json { "payme_client_key": "payme_partner_key", "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "vas_payme_id": "VASLDEMO-BIT-VASLDEMO-1234567" } ``` The response is either the seller's active service (`status_code: 0`, `vas_is_active: true`), or `status_code: 2` with the message `Zendesk ticket created` when PayMe's team completes the setup. The whole flow, including how to check the result, is on [Enable payment methods and services for your sellers](/marketplaces-and-platforms/seller-onboarding/enable-services). Without the service, `generate-sale` with `bit` fails with error `720`, and `multi` pages don't show Bit. ## Create a Bit sale Call [`generate-sale`](/payments/hosted-payment-page/post-generate-sale) from your server with `sale_payment_method: bit`. `POST https://sandbox.payme.io/api/generate-sale` (production: `https://live.payme.io/api/generate-sale`) ```json { "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "sale_payment_method": "bit", "sale_price": 1000, "currency": "ILS", "product_name": "Order 1234", "transaction_id": "order-1001", "sale_callback_url": "https://your-server.example.com/payme/callback", "sale_return_url": "https://your-site.example.com/payment/success", "sale_mobile": "+972500000040", "language": "en" } ``` ```json { "status_code": 0, "session": "AtsJ0as5", "sale_url": "https://sandbox.payme.io/sale/generate/SALE1700-000000AA-EXAMPLE1-SALE0001", "payme_sale_id": "SALE1700-000000AA-EXAMPLE1-SALE0001", "payme_sale_code": 12345678, "price": 1000, "transaction_id": "order-1001", "currency": "ILS", "sale_payment_method": "bit" } ``` Show `sale_url` to the buyer in an iframe or a redirect, and store `payme_sale_id`. Partners also send `payme_client_key`; see [Authentication](/payments/getting-started/authentication). Options: - `layout: qr-sms` adds a "Payment link via SMS" option: the buyer enters an Israeli mobile number and gets the payment link by SMS. `sale_mobile` pre-fills the number. - To offer Bit next to cards and wallets, send `sale_payment_method: multi`. See [Let the buyer choose how to pay](/accepting-payments/checkout-and-in-person/let-the-buyer-choose). The request the buyer sees in the Bit app carries the seller's business name, not `product_name`. ## What the buyer does 1. The buyer opens `sale_url`. 2. On a computer, the page shows a QR code: the buyer scans it with their phone. On a phone, the page shows a button that opens the Bit app. 3. The buyer approves the payment in Bit. On a phone, Bit then brings the buyer back to the payment page. 4. PayMe completes the charge with Bit, shows the result, sends `sale-complete`, and redirects the buyer to `sale_return_url`, if you sent it. Each new Bit request on a sale cancels the open one before it, so a buyer who reloads the page can't pay twice. If the buyer closes the page after approving, PayMe keeps checking the request in the background. The sale still completes and the callback still arrives, possibly several minutes later. Don't treat a closed page as a failed payment: wait for the callback, or check the sale with [`get-sales`](/payments/query-apis/post-get-sales). ## Outcomes and callbacks | `notify_type` | When | |---|---| | `sale-complete` | The buyer approved and PayMe completed the charge. `sale_payment_method` is `bit` (also on a `multi` sale), and `installments` is `1`. | | `sale-failure` | A Bit request ended without a payment. The reason is in `status_error_code`. | | `refund` | The sale was refunded | A Bit request ends with one of these codes: | `status_error_code` | Meaning | PayMe's message | What to do | |---|---|---|---| | `23001` | The buyer rejected the request in Bit | "The request was rejected by the customer" | Let the buyer try again or choose another method. | | `23002` | The request was canceled before the buyer paid it | "The request was canceled by the business" | Let the buyer start a new request. | | `23003` | The request expired before the buyer approved it | "The request has expired" | Let the buyer start a new request, and approve it in Bit straight away. | Other codes are listed on [Errors](/payments/getting-started/errors). A failed request doesn't close the sale: its status is `failed`, and the same `sale_url` stays payable, unless `sale_expiry_seconds` has passed. The buyer can start a new Bit request from the page, and a later success sends `sale-complete`. Callback fields, signature and delivery rules are on [Callbacks](/payments/getting-started/callbacks). ## Refunds Refund a Bit sale with [`refund-sale`](/payments/post-sale-actions/post-refund-sale), in full or in part. The money goes back to the buyer through Bit. ```json { "seller_payme_id": "MPLDEMO-MPLDEMO-MPLDEMO-1234567", "payme_sale_id": "SALE1700-000000AA-EXAMPLE1-SALE0001", "sale_refund_amount": 500, "language": "en" } ``` If you refund a Bit sale in several parts, leave at least 5 minutes between two refunds of the same sale. ## Test Bit Ask PayMe how to test Bit in the sandbox before you go live. You can test the rest of your integration (callbacks, `get-sales`, refunds) with the cards on [Test Cards and Payment Methods](/payments/getting-started/test-cards-and-payment-methods).