Skip to main content
This guide walks you through the complete flow of creating and verifying a transaction using Propaga’s API. The process consists of two main steps:
  1. Creating a new transaction (which generates a verification code)
  2. Validating the transaction with the verification code

Step 1: Create a Transaction

First, you’ll need to create a new transaction. This will generate a verification code that will be sent to the customer.
curl --location --request POST 'https://staging-api.propaga.io/v1/transaction' \
--header 'Authorization: <your_awesome_token>' \
--header 'Content-Type: application/json' \
--data '{
    "cornerStoreId": "57b9d911-1c6e-45c0-be98-bfaeec8d9cf8",
    "totalAmount": 1234,
    "wholesalerTransactionId": "123413123123",
    "deliveryDate": "2024-12-31",
    "products": [
        {
            "externalSKU": "7501018310103",
            "name": "Pasta Spaghetti La Moderna - Moderna - Paquete 200 g",
            "quantity": 5
        }
    ],
    "metadata": {}
}'

Request Body

The request body should contain the following parameters:
ParameterTypeDescription
cornerStoreIdStringThe ID of the corner store where the transaction will be created.
totalAmountNumberThe total amount of the transaction.
wholesalerTransactionIdStringThe ID of the transaction in the wholesaler’s system.
deliveryDateStringThe expected delivery date of the transaction.
metadataObjectAn object containing any additional metadata for the transaction.
productsArray of ObjectsAn array of products in the transaction. Each product object should contain the following parameters:
ParameterTypeDescription
externalSKUStringThe SKU of the product.
nameStringThe name of the product.
quantityNumberThe quantity of the product.
If the request is successful, you’ll receive a response like this:
{
    "incrementalID": 999,
    "transactionId": "13e8b9f0-b73f-4498-a245-05aaae7893dc",
    "verificationId": "561f8ed5-8e90-4b32-9637-4f36a0c66286",
    "userPhoneNumber": "****1207"
}
Make sure to store the transactionId and verificationId as you’ll need them for the next step.

Create transaction use-case

Get more information about the create transaction use-case.

Step 2: Validate the Transaction

Once the customer receives the verification code, you’ll need to validate the transaction using both the transactionId and verificationId from the previous step.
curl --location --request PUT 'https://staging-api.propaga.io/v1/transaction/{transactionId}/verification/{verificationId}' \
--header 'Authorization: <your_awesome_token>' \
--header 'Content-Type: application/json' \
--data '{
    "errorCode": "1234"
}'
If the verification is successful, you’ll receive a response like this:
{
    "verificationId": "561f8ed5-8e90-4b32-9637-4f36a0c66286",
    "verificationStatus": "Transaction verified successfull"
}

Validate transaction use-case

Get more information about the validate transaction use-case.

Error Handling

Both endpoints may return various error responses that you should handle in your implementation:

Create Transaction Errors

  • Corner store not found (404)
  • Amount exceeded the limit credit available (422)
  • User is in default (422)
  • Transaction amount below the minimum required (422)
  • User not verified (422)
  • Invalid delivery date (422)

Validate Transaction Errors

  • Transaction not found (404)
  • Transaction is already verified (422)
  • Verification not found (404)
  • Verification not valid (422)
Make sure to implement proper error handling in your code to manage these potential error responses.