NAV
cURL

Introduction

Welcome to the Guita API. This API allows merchant applications or services to request a payment from a client (Guita wallet) using the mobile phone number registered as identifier.

This API was specifically designed to facilitate "CASH IN" transactions for merchants exclusively.

This API documentation is maintained by the Guita Team - dev@guita.co.ao

Format

The format used to communicate with Guita API is through JSON requests and all the requests header should have a Content Type and Accept headers and have a valid JSON body (if required).

Content-Type: application/json

Accept: application/json

JSON body: The data within the payload fields should be in string format.

Timing

This timing specification is intended exclusively for the production environment.

New Payment Authorization: OTP timing

New Payment Confirmation: 10 minutes to confirm using the OTP PIN

New Refund: Adicional 10 minutes to Refund after Confirmation

Explanation:

The expiration time for Authorization request is 10 minutes, meaning that once the client receives the OTP, there is a 10-minute window to Confirm the payment. After the client confirms the payment to the merchant's account, there is also a 10-minute limit to initiate a Refund for the received amounts.

Environment

We're currently supporting production and sandbox environment to easily integrate using the same endpoint hostname. To determine the system if is either production or sandbox we use a unique token created at merchant portal for the specified system environment.

Authentication

To be able to use the Guita API you need to authenticate your requests through a bearer token in the Authorization header.

Authorization: Bearer [bearer_token]

Transaction Lifecycle

image info

TRANSACTIONS

New Payment - Authorization

curl -XPOST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0" \
  "https://external.api.guita.co.ao/v1/transactions" \
  -d '{"service": "wallet", "type": "authorization", "mobile": "912123123", "amount": "120048",
  callback_url: "https://your-hostname/link/to/confirm"}'

The above command returns a structure like this:

HTTP/1.1 202 Accepted
location: /v1/requests/b82b1dc4-f22b-48f5-90d8-c01c62339ebf

This resource endpoint allows to create a new payment authorization transaction.

HTTP Request

POST https://external.api.guita.co.ao/v1/transactions

Payload

Name Type Required Description
service string true Only accepts wallet
type string true Only accepts authorization, confirmation or refund
mobile string true The customer phone number without the country code
amount string true The amount of payment request must be a string. For decimal numbers (e.g., 5.34), the decimal separator should be a dot ('.') If a comma is provided, the value will be treated as an integer (e.g., 5).
callback_url string false Recommended but not required field to which Guita's API will respond to as soon it completes.

Responses

Status Meaning Description
202 Accepted The payment authorization request was accepted by the API for processing, but the final status will depend on the account's situation. The location to monitor the final status was provided in the returned message in the Location header.
4xx or 5xx Rejected Please check the error table

New Payment - Confirmation

curl -XPOST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0" \
  "https://external.api.guita.co.ao/v1/transactions" \
  -d '{"service": "wallet", "type": "confirmation", "otp": "123456", "parent_transaction_id": "b82b1dc4-f22b-48f5-90d8-c01c62339ebf", callback_url: "https://your-hostname/link/to/confirm"}'

The above command returns a structure like this:

HTTP/1.1 202 Accepted
location: /v1/requests/07f40cd7-9744-4c31-bfbc-c634ab53645f

This resource endpoint allows to create a new payment confirmation transaction.

HTTP Request

POST https://external.api.guita.co.ao/v1/transactions

Payload

Name Type Required Description
service string true Only accepts wallet
type string true Only accepts authorization, confirmation or refund
otp string true The one time password that is sent to the client registered cellphone.
parent_transaction_id uuid true The uuid of the authorization transaction which is being returned in the response's location header.
callback_url string false Recommended but not required field to which Guita's API will respond to as soon it completes.

Responses

Status Meaning Description
202 Accepted The payment confirmation request was accepted by the API for processing, but the final status will depend on the account's situation. The location to monitor the final status was provided in the returned message in the Location header.
4xx or 5xx Rejected Please check the error table

New Refund

curl -XPOST \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0" \
  "https://external.api.guita.co.ao/v1/transactions" \
  -d '{service: "wallet", "type": "refund", "parent_transaction_id": "07f40cd7-9744-4c31-bfbc-c634ab53645f",
  callback_url: "https://your-hostname/link/to/confirm"}'

The above command returns a structure like this:

HTTP/1.1 202 Accepted
location: /v1/requests/bfbc1dc4-f22b-48f5-4c31-c01c62339ebf

This resource endpoint allows to create a new refund transaction.

HTTP Request

POST https://external.api.guita.co.ao/v1/transactions

Payload

Name Type Required Description
service string true Only accepts wallet
type refund true Only accepts authorization, confirmation or refund
parent_transaction_id uuid true The uuid of the confirmation transaction which is being returned in the response's location header.
callback_url string false Recommended but not required field to which Guita's API will respond to as soon it completes.

Responses

Status Meaning Description
202 Accepted The refund request was accepted by the API for processing but the final status will depend on the situation of the account. The location to monitor the final status was provided at the returned message in the Location header.
4xx or 5xx Rejected Please check the error table

Request

curl "https://external.api.guita.co.ao/v1/requests/90fa3a8a-2895-4d37-ab4b-7afd90de375a" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0"

The above command returns a structure like this:

HTTP/1.1 200 OK
Exemplar of Success
{
    "id": "d02969b0-d3f9-ab4b-2895-7afd90de375a ",
    "type": "confirmation",
    "service": "wallet",
    "parent_transaction_id": "e255c4c3-d8f7-4bd9-82e1-758fcf238656",
    "mobile": "912123123",
    "amount": "1.43",
    "status": "accepted",
    "status_reason": 'GT_2000',
    "status_datetime": "2024-01-23T13:00:25.771Z"
}

Exemplar of Failure
{
    "id": "90fa3a8a-87c2-4d37-d3f9-3f7773197599",
    "type": "authorization",
    "service": "wallet",
    "parent_transaction_id": null,
    "mobile": "912123123",
    "amount": "1.43",
    "status": "rejected",
    "status_reason": "GT_9000",
    "status_datetime": "2024-01-23T15:06:10.918Z"
}

This resource endpoint allows to verify the status of authorization, confirmation as well as refund transactions.

HTTP Request

GET https://external.api.guita.co.ao/v1/requests/{uuid}

Responses

Status Meaning Description
200 Accepted The request was accepted by the API for processing and a response body is returned as well.
4xx or 5xx Rejected Please check the error table

Sandbox

All the structures and payloads explained above are identical for both the production and sandbox environments. To properly utilize the Sandbox environment, please adhere to the instructions below:

Important Note: Ensure to anticipate and address all expected errors in the production environment.

ERRORS

Transaction Codes

HTTP/1.1 200 OK 
These attributes constitute components of the payload included in the response 
body of "Request" call

{
    "id": "d02969b0-9744-42ab-87c2-c634ab53645f",
    "type": "authorization",
    "service": "wallet",
    "parent_transaction_id": "07f40cd7-9744-4c31-bfbc-c634ab53645f",
    "mobile": "912123123",
    "amount": "1.43",
    "status": "accepted",
    "status_reason": "GT_2000",
    "status_datetime": "2024-01-23T13:00:25.771Z"
}

OR

{
    "id": "d02969b0-9744-42ab-87c2-c634ab53645f",
    "type": "confirmation",
    "service": "wallet",
    "parent_transaction_id": "07f40cd7-9744-4c31-bfbc-c634ab53645f",
    "mobile": "912123123",
    "amount": "1.43",
    "status": "rejected",
    "status_reason": "GT_9000",
    "status_datetime": "2024-01-23T13:00:25.771Z"
}

In case of error while using the Guita API these are the ones we've documented for you:

Status NEW Status Reason ✅ Description
Accepted GT_2000 Success. Operation completed successfully ✅
Rejected GT_1000 Invalid phone number
Rejected GT_1001 Invalid amount format
Rejected GT_1005 Phone Number / Online Payment disabled on GUITA APP
Rejected GT_1008 Resource Request Execution Timeout (check the timing table)
Rejected GT_2001 Insufficient funds to complete the transaction
Rejected GT_2002 Defused / Rejected by customer
Rejected GT_3030 Amount exceeds the limit / Amount less than the minimum allowed
Rejected GT_4000 Bad request, Required or invalid attribute, Service unavailable, Operation not executed
Rejected GT_4006 Resource request already processed / done
Rejected GT_4007 Parent resource already processed / done
Rejected GT_4008 Resource request canceled
Rejected GT_4011 Invalid account credentials provided
Rejected GT_4012 Invalid / Expired token.
Processing GT_4015 Resource request in progress / requested
Rejected GT_4030 Account is blocked / locked / disabled
Rejected GT_4040 Resource not found
Rejected GT_6004 Communication failure
Rejected GT_6040 Account no found
Rejected GT_9000 Unknown error / Generic error
HTTP/1.1 200 OK 
These attributes constitute components of the payload included in the response 
body of "Request" call

{
    "status": "accepted",
    "status_reason": null,
}

OR

{
    "status": "rejected",
    "status_reason": "19",
}
Status OLD Status Reason ❌ NEW Status Reason ✅ Description
Accepted null / 0 GT_2000 Success. Operation completed successfully.
Rejected 1 GT_9000 An unknown error occurred during the process. Please contact the Guita support team.
Rejected 3 GT_4040 Transaction not found. The transaction was not found; please retry the operation.
Rejected 5 GT_4011 Invalid credentials provided.
Rejected 7 GT_4000 Invalid fields sent. Check the format and names of the sent fields.
Rejected 14 GT_2001 Insufficient funds to complete the transaction. The client does not have sufficient funds to cover the value of the operation.
Rejected 16 GT_1005 Phone not enabled. The client has not enabled the option for online payment in the Guita App.
Rejected 18 GT_4012 Expired token. Generate a new authentication token.
Rejected 19 GT_4012 Invalid token. The sent token is invalid; generate a new authentication token.
Rejected 21 GT_3030 Value exceeds the limit. The value exceeds the allowed limit for the partner profile.
Rejected 27 GT_9000 Handled error. Please contact the Guita support team.
Rejected 49 GT_3030 Value less than the minimum allowed. The value is less than the minimum allowed for the partner profile.
Rejected 251 GT_6004 Communication failure with the partner. Communication failure with the partner for the settlement of the operation.
Rejected 256 GT_4006 Transaction already confirmed. No further action is necessary.
Rejected 257 GT_4008 Transaction canceled. Cancellation operation completed successfully.
Processing 320 GT_4015 Transaction in progress. Please wait for the processing to finish.
Rejected 360 GT_4000 Operation not executed. Beneficiary cannot be the same as the payer.
Rejected 365 GT_4030 Beneficiary's account is blocked. The account is blocked.
Rejected 512 GT_6040 Emitter's account not found. Emitter's account not found on the Guita platform; verify the sent phone number.
Rejected 513 GT_4030 Emitter's account is blocked. The emitter's account is blocked.
Rejected 514 GT_2001 Insufficient funds in emitter's account to complete the transaction. The client does not have sufficient funds to cover the value of the operation.
Rejected 515 GT_2001 Insufficient funds in emitter's account to cover the fee. The client does not have sufficient funds to cover the fee charged by the platform.
Rejected 516 GT_6040 Beneficiary's account not found. Beneficiary's account not found. Verify sent data.
Rejected 517 GT_2001 Insufficient funds in beneficiary's account to complete the transaction. The partner does not have sufficient funds to cover the value of the operation.
Rejected 518 GT_2001 Insufficient funds in beneficiary's account to cover the fee. The partner does not have sufficient funds to cover the fee charged by the platform.
Rejected 519 GT_1008 The maximum time for transaction confirmation has expired. It is no longer possible to confirm the transaction; the operation is automatically canceled by the system, and the operation must be redone.
Rejected 520 GT_1008 The maximum time to cancel the Executed transaction has expired. It is no longer possible to command the cancellation of the transaction; the operation is automatically canceled by the system, and the operation must be redone.
Rejected 521 GT_1008 The maximum time to cancel the Confirmed transaction has expired. It is no longer possible to cancel the transaction.
Rejected 999 GT_9000 Generic or Unknown error. Please contact the Guita support team.

TESTING

SANDBOX OTP

The One-Time Password (OTP) utilized in the transaction confirmation tests will play a decisive role in determining the outcome of the transaction. The following are the scenarios effectively managed by the sandbox.

Kindly consult the error table for more accurate reference by utilizing the Status Reason.

OTP Status Status Reason Details
101010 accepted GT_2000 Generates an accepted transaction initiated by the client.
202020 rejected GT_2001 Generates a rejected transaction by the processor due to insufficient funds in the client's account, thereby preventing the completion of the transaction.
303030 rejected GT_4012 Generates a rejected transaction due to the submission of an invalid token by the client.
other... rejected GT_9000 Generates a rejected transaction based on any other refusal reason specified by the processor.