OGWUGO API DOCUMENTATION

  1. Home
  2. Docs
  3. OGWUGO API DOCUMENTATION
  4. Main Server Documentation
  5. Pay Order/Invoice

Pay Order/Invoice

Method : GET

Paying for invoice is very simple and involves calling the payment verification endpoint.

if the payment method is ‘wallet’, once you call the endpoint the API will deduct the money from buyer wallet and mark the invoice as paid. if the user have insufficient fund it will return failed with message= insufficient fund.

likewise if the payment method is paystack, calling this endpoint also consults paystack and confirms the payment.

Verify Payment

path:

[GET] /invoice/pay/{order_id}?user={user_id}&ref=optional(paystack)

RESPONSE

{
    "data": [
        {
            "title": "wallet payment",
            "paid": "1"
        }
    ],
    "status": "success",
    "message": "payment completed and verified",
    "error": {
        "detail": "",
        "code": ""
    }
}

 

Submitting paystack payment.

the invoice/order has details as

{
    "data": [
        {
            "invoice_id": "1",
            "user_id": "ogwugo",
            "invoice_number": "ogw1000454333", 
            "amount": "5000",  
            "with_paystack_fee": "5250", 
             .

refer to paystack.  https://developers.paystack.co/docs/paystack-inline

paystack   = Ogwugo

amount =with_paystack_fee
ref = invoice_number
then things like customer email/phone, collect from user data

once the payment is collected by paystack, they should give you a call back with “ref” this ref is also the invoice_number, kindly post the invoice_number=>order_id to verification endpoint to verify the payment.

Bitcoin Payment: 

Coming soon. bitcoin payment APi will be live soon.

it will involve an endpoint to generate bitcoin wallet for user to pay into,. calling the verify endpoint will also verify the payment if the user payment has confirmed in blockchain

Was this article helpful to you? Yes No

How can we help?