Api

Transfers

Transfer Money using SP Pay RESTful API.

These endpoints are protected. You will need a Bearer token attached to each request. Learn more.

Validate a Transfer

POST - Validate Transfer

Request to validate a transfer. Validating a transfer performs all the necessary activities prior to submitting the transaction. However, the response is returned without submitting the transaction.

Endpoint

{{sppay-host}}/v1/api/transfers/validate

Request

{
    "send_account_no": "1001",
    "amount": 2,
    "recipient": {
        "account": {
            "code": "SPP",
            "number": "1000"
        },
        "first_name": "SP Pay",
        "last_name": "Cedi Account ",
        "town_or_city": "Accra",
        "address": "Accra",
        "reason_for_sending": "Test",
        "country_code": "GH",
        "state_or_region_code": "GH-AA",
        "id_type": "GHANA_CARD",
        "id_reference": "1234"
    },
    "referece": "test",
    "callback_url": "{{sppay-host}}/v1/sp-pay/webhook"
}

send_account_norequired
String

Your SP Pay account that will be debited.

amountrequired
double

The amount you want to send.

recipientrequired
Object

Object of recipient details.

accountrequired
Object

Object of recipient account details.

coderequired
String

Recipient account code.

numberrequired
String

Recipient account number.

first_name
String

First name of recipient. Only required for remittance transactions.

last_name
integer

Last name of recipient. Only required for remittance transactions.

town_or_city
String

Town or city of recipient. Only required for remittance transactions.

address
String

Address of recipient. Only required for remittance transactions.

reason_for_sending
String

Reason for sending the money. Only required for remittance transactions.

country_code
String

Alpha 2 country code of the recipient. Only required for remittance transactions.

state_or_region_code
String

State or region code of the recipient. Only required for remittance transactions.

id_type
String

ID type code of the recipient. Only required for remittance transactions.

id_reference
String

ID reference of the recipient. Only required for remittance transactions.

reference
String

Transaction reference which will be sent to recipient via SMS.

callback_urlrequired
String

URL to which final transaction status and information will be sent to.

Response

{
    "external_reference": null,
    "type_code": "ITRF",
    "type_name": "Internal Transfer",
    "debit_currency": "GHS",
    "debit_amount": 2,
    "credit_currency": "GHS",
    "credit_amount": 2,
    "rate": 1,
    "debit_account_no": 1000,
    "debit_account_name": "SP Pay Cedi Account 1",
    "debit_account_type_code": "SUBS",
    "debit_account_type_name": "Subscriber",
    "debit_account_institution_code": "SPP",
    "debit_account_institution_name": "SP Pay",
    "credit_account_no": 1001,
    "credit_account_name": "SP Pay Cedi Account 2",
    "credit_account_type_code": "SUBS",
    "credit_account_type_name": "Subscriber",
    "credit_account_institution_code": "SPP",
    "credit_account_institution_name": "SP Pay",
    "charge_setting": 2,
    "charge_amount": 0.02,
    "charge_account": "Debit",
    "taxable_amount": 0,
    "tax_amount": 0,
    "tax_account": "Debit",
    "payment_category": null
}

external_reference
String

Reference visible to the user and submitted in the request.

type_code
String

Transaction type code.

type_name
String

Full name of the transaction type.

debit_currency
String

Currency of the debit account.

debit_amount
double

Amount debited from the debit account.

credit_currency
String

Currency of the credit account.

credit_amount
double

Amount credited to the credit account.

rate
double

Transaction rate. Transaction Rate = Credit Amount / Debit Amount.

debit_account_no
String

Account number of the debit account.

debit_account_name
String

Name on the debit account.

debit_account_type_code
String

Type code of the debit account.

debit_account_type_name
String

Type name of the debit account.

debit_account_institution_code
String

Intitution code of the debit account.

debit_account_institution_name
String

Intitution name of the debit account.

credit_account_no
String

Account number of the credit account.

credit_account_name
String

Name on the credit account.

credit_account_type_code
String

Type code of the credit account.

credit_account_type_name
String

Type name of the credit account.

credit_account_institution_code
String

Institution code of the credit account.

credit_account_institution_name
String

Institution name of the credit account.

charge_setting
integer

ID of the charge setting applied.

charge_amount
double

Amount charged for the transaction. This amount is always in the currency of the charged account below.

charge_account
String

Account to which charge is applied. Debit indicating the Debit Account. Credit indicating the Credit account.

taxable_amount
double

Amount of the transaction that can be taxed. This is always in the currency of the tax account.

tax_amount
double

Amount debited from tax account as tax.

tax_account
String

Account from which tax is applied. Debit indicating the Debit Account. Credit indicating the Credit account.

payment_category
Object

Object of payment category if a payment category is applied.

Submit a Transfer

POST - Submit Transfer

Request to submit a transfer transaction. This is similar to the validate transfer and performs all the validation activities. In addition to this, the transaction is submitted for processing.

Endpoint

{{sppay-host}}/v1/api/transfers/submit

Request

{
    "send_account_no": "1001",
    "amount": 2,
    "recipient": {
        "account": {
            "code": "SPP",
            "number": "1000"
        },
        "first_name": "SP Pay",
        "last_name": "Cedi Account ",
        "town_or_city": "Accra",
        "address": "Accra",
        "reason_for_sending": "Test",
        "country_code": "GH",
        "state_or_region_code": "GH-AA",
        "id_type": "GHANA_CARD",
        "id_reference": "1234"
    },
    "referece": "test",
    "callback_url": "{{sppay-host}}/v1/sp-pay/webhook"
}

send_account_norequired
String

Your SP Pay account that will be debited.

amountrequired
double

The amount you want to send.

recipientrequired
Object

Object of recipient details.

accountrequired
Object

Object of recipient account details.

coderequired
String

Recipient account code.

numberrequired
String

Recipient account number.

first_name
String

First name of recipient. Only required for remittance transactions.

last_name
integer

Last name of recipient. Only required for remittance transactions.

town_or_city
String

Town or city of recipient. Only required for remittance transactions.

address
String

Address of recipient. Only required for remittance transactions.

reason_for_sending
String

Reason for sending the money. Only required for remittance transactions.

country_code
String

Alpha 2 country code of the recipient. Only required for remittance transactions.

state_or_region_code
String

State or region code of the recipient. Only required for remittance transactions.

id_type
String

ID type code of the recipient. Only required for remittance transactions.

id_reference
String

ID reference of the recipient. Only required for remittance transactions.

reference
String

User provided reference which will be sent to recipient via SMS.

callback_urlrequired
String

URL to which final transaction status and information will be sent to.

Response

{
    "id": 37,
    "reference": "LQP592I3JK",
    "external_reference": "",
    "primary": 1,
    "type_code": "ITRF",
    "currency": "GHS",
    "amount": "2.00",
    "debit_account_name": "SP Pay Cedi Account 1",
    "debit_account_no": "1000",
    "debit_account_institution_code": "SPP",
    "credit_account_name": "SP Pay Cedi Account 2",
    "credit_account_no": "1001",
    "credit_account_institution_code": "SPP",
    "status": 2,
    "status_message": "Submitted to queue for processing",
    "created_at": "Tue, 05 Mar 2024 18:15:51 GMT",
    "updated_at": "Tue, 05 Mar 2024 18:15:51 GMT",
    "charge": {
        "id": 38,
        "reference": "LQP592I3JK",
        "external_reference": "",
        "primary": 0,
        "type_code": "CHRG",
        "currency": "GHS",
        "amount": "0.02",
        "debit_account_name": "SP Pay Cedi Account 1",
        "debit_account_no": "1000",
        "debit_account_institution_code": "SPP",
        "credit_account_name": "SP Pay GHS Suspense Account",
        "credit_account_no": "101",
        "credit_account_institution_code": "SPP",
        "status": 1,
        "status_message": "Created. Pending submission",
        "created_at": "Tue, 05 Mar 2024 18:15:51 GMT",
        "updated_at": "Tue, 05 Mar 2024 18:15:51 GMT",
        "payment_category": null,
        "pending_actions": []
    },
    "initiator_id": 1,
    "payment_category": null,
    "pending_actions": []
}

id
integer

Unique ID of transaction.

reference
String

System generated reference of transaction.

external_reference
String

User provided reference which will be sent to recipient via SMS.

primary
integer

Flag to indicate whether transaction is a primary transaction or secondary transaction. 1 for primary and 0 for secondary. Secondary transactions are transactions that are generated by system based on certain conditions. E.g. Tax and Charge transactions.

type_code
String

Type code of the debit account.

currency
String

Currency code of the credit amount.

amount
String

Amount credited to credit account. This is always in the currency of the credit account.

debit_account_name
String

Name on the debit account.

debit_account_no
String

Account number of the debit account.

debit_account_institution_code
String

Institution code of the debit account.

credit_account_name
String

Name on the credit account.

credit_account_no
String

Account number of the credit account.

credit_account_institution_code
String

Insitution code of the debit account

status
String

Status ID of the transaction.

status_message
String

Status message of the transaction.

created_at
String

Time the transaction was created.

updated_at
String

Time the transaction wass last updated.

charge
Transaction

Object of the charge transaction. The structure is identical to the transaction object for which it is a part of. It is only returned if a charge exists.

tax
Transaction

Object of the tax transaction. The structure is identical to the transaction object for which it is a part of. It is only returned if a tax exists.

initiator_id
String

ID of the user who created or submitted the transaction.

payment_category
Object

Object of payment category if a payment category is applied.

pending_actions
Array

Array of pending actions.


Copyright © 2024