API Reference V1 - sabereen/fum-cloud-shop GitHub Wiki

Heartbeat


This is used to check if the service is up.
HTTP Method GET
URL /account/heartbeat
Request Body empty
Response OK 200 OK
Response ERROR no response

Create profile


This is used to create and register a new profile and wallet.
HTTP Method POST
URL /account/profile
Request Body

{
    "email":"A Valid email",
    "password":"A Valid password",
    "name":"optional name",
    "phoneNo":"optional phoneNo",
    "nationalCode":"optional nationalCode",
    "address":"optional address",
    "postalCode":"optional postalCode"
}
Response OK 201 Created

{
    "token": "GENERATED_TOKEN"
}
Response ERROR 400 Invalid Parameters
409 Email Already Exists

Update profile


This is used to update profile.
HTTP Method PUT
URL /account/profile
Request Body

{
    "name":"required name",
    "phoneNo":"required phoneNo",
    "nationalCode":"required nationalCode",
    "address":"required address",
    "postalCode":"required postalCode"
}
Response OK 200 OK

{
    "name":"profile name",
    "phoneNo":"profile phoneNo",
    "nationalCode":"profile nationalCode",
    "address":"profile address",
    "postalCode":"profile postalCode"
}
Response ERROR 400 Invalid Parameters
401 Invalid Token
404 Email Not Found

Get profile


This is use to get profile.
HTTP Method GET
URL /account/profile
Request Body empty
Response OK 200 OK

{
    "email":"profile email",
    "name":"profile name",
    "phoneNo":"profile phoneNo",
    "nationalCode":"profile nationalCode",
    "address":"profile address",
    "postalCode":"profile postalCode"
}
Response ERROR 400 Invalid Parameters
401 Invalid Token
404 Email Not Found

Get wallet


This is used to get value of profile wallet.
HTTP Method GET
URL /account/wallet
Request Body

{
    "value":"wallet value"
}
Response OK 200 OK
Response ERROR 400 Invalid Parameters
401 Invalid Token / Not Authorized

New pay


This is used to create a new payment from order and create new transaction and redirect to zarinpall. .
HTTP Method POST
URL /account/pay
Request Body
{
    "orderID":"orderID of order"
}
Response OK 200 redirect to zarinpall
Response ERROR 400 Invalid Parameters
401 Invalid Token / Not Authorized

Get callback


this is used to get callback of pay and need authority and transactionID query params.
HTTP Method GET
URL /account/pay/callback?authority={{authority}}&transactionID={{transactionID}}
Request Body empty
Response OK 200 OK

Response ERROR 400 Invalid Parameters
404 transaction Not Found

Get transactions


This is used to get list of transactions.
HTTP Method GET
URL /account/transactions
Request Body

Response OK 200 OK list of transactions
Response ERROR 400 Invalid Parameters
401 Invalid Token / Not Authorized
404 Not Found
⚠️ **GitHub.com Fallback** ⚠️