Skip to content
Paybob

Payment

Create Payment

Create a checkout and get a payment URL to send your customer to.

POST{base_url}/api/checkout

Creates a checkout for the given amount and returns its ID (pp_id) and payment page URL (pp_url). Redirect your customer to pp_url: they pick a payment method and pay, then return to your return_url.

Store pp_id with your order. Don't treat the customer's return to return_url as proof of payment: confirm the payment with Verify Payment or the Webhook sent to your webhook_url.

Authentication

Send your API key in the MHS-PIPRAPAY-API-KEY header: MHS-PIPRAPAY-API-KEY: YOUR_API_KEY. Create keys in System Settings → API Settings.

The key needs the payment:checkout ability, otherwise the request fails with INSUFFICIENT_ABILITY.

Body parameters

  • full_namestring

    Customer's full name, shown on the payment page.

  • email_addressstring

    Customer's email address.

  • mobile_numberstring

    Customer's mobile number.

  • amountstring

    Amount to charge, as a decimal string.

  • currencystring

    Currency code, e.g. bdt.

  • metadataobject

    Your own key-value data, such as your order ID, kept with the payment.

  • return_urlstring

    Where the customer is sent after the payment page.

  • webhook_urlstring

    Where Paybob sends payment status updates for this checkout.

Responses

  • SuccessCheckout created. Redirect the customer to pp_url.
  • INVALID_API_KEYThe API key is missing, wrong or revoked.
  • INSUFFICIENT_ABILITYThe API key exists but doesn't have the payment:checkout ability.