# Transactions Guide

This guide takes you through each step of the process after your item sells, right from purchase to delivery. Let’s get started!

Technical Focus
This guide offers a *technical* overview with all the nitty-gritty details you need, including sample API requests. For a broader, more *conceptual* understanding, make sure to check out [How Transactions Work](/pages/api-essentials/how-transactions-work).

The following sequence diagram demonstrates the actions performed by the API client during the transaction process:

```mermaid
sequenceDiagram
    participant Seller
    participant API


    Seller->>API: GET /transactions/requests/pending
    API-->>Seller: 200 OK + Pending Requests List

    Seller->>API: Check drop_off_mode in response
    API-->>Seller: "post office" or "home pickup"

    alt Home Pickup
        Seller->>API: POST /transactions/requests/{requestId}/accept/home-pickup
        API-->>Seller: 204 No Content (Accepted)
    else Post Office Drop-Off
        Seller->>API: POST /transactions/requests/{requestId}/accept/post-office
        API-->>Seller: 204 No Content (Accepted)
    end

    Seller->>API: GET /transactions/pending
    API-->>Seller: 200 OK + Pending Transactions List

    Note right of Seller: Monitor and complete shipping within 5 days
```

## 1) View Pending Shipping Requests

Once your buyer completes payment for the item and delivery fee, a shipping request is generated. It's time for you to take action—accept the shipping request to kick off the shipping process! You can discover pending requests through an automatic method like a [webhook](/pages/guides/webhooks) or by manually sending an API request.

To find out what’s waiting for your attention, send a **GET** request to `/transactions/requests/pending`:

```shell cURL
curl -i -X GET \
  https://connect.wallapop.com/transactions/requests/pending \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

You'll get a friendly `200` **OK** status code back, along with a list of shipping requests just waiting to be accepted!

## 2) Identify the Drop-Off Mode

Now that you know there are pending requests, you need to identify the `drop_off_mode` for your item. Look for this property:

- `requests[].carrier_drop_off_options.options[].drop_off_mode`


The value will be either `post office` or `home pickup`. This will guide you on what type of API request to send next.

Drop off mode
The drop-off mode is selected either by the buyer or according to Wallapop's rules.

Retrieving specific shipping requests
To find details about a specific shipping request, send a GET request to `/transactions/requests/{requestId}`, replacing `{requestId}` with the appropriate ID.

## 3) Seller Accepts Shipping Request

Now that the drop-off mode has been identified, you, the seller, can accept the shipping request for either `home pickup` or `post office` drop-off.

Make sure to include the `requestId` of the shipping request you want to accept, and don’t forget to generate a `transaction_id` to include in your API request.

### Option A: Home Pickup

To accept a shipping request for home pickup, you’ll want to send a **POST** request to `/transactions/requests/{requestId}/accept/home-pickup`.

And voilà! A successful request returns a delightful `204 No Content` status code, signaling that the shipping request has been successfully accepted for home pickup.

### Option B: Post Office Drop-Off

Prefer the post office? No problem! Send a POST request to `/transactions/requests/{requestId}/accept/post-office`.

You'll receive a `204 No Content` status code if everything went through smoothly, confirming that your request for post office drop-off was accepted.

## 4) View Pending Transactions

Once you’ve accepted the shipping request, a shipping transaction will be generated. Keep an eye on it! To check on pending transactions—those that haven’t yet reached a final state—send a **GET** request to `/transactions/pending`:

```shell cURL
curl -i -X GET \
  https://connect.wallapop.com/transactions/pending \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>'
```

Again, a `200` **OK** status code will greet you, along with details on transactions that are still in motion. This is your opportunity to monitor the status of the shipment, ensuring it arrives safely and on time—or to troubleshoot any issues that might need Wallapop’s assistance.

Remember, as a seller, you have a **5-day** window to get that package on its way, based on the delivery method your buyer has chosen—like dropping it off at Correos.

Congratulations, you've now mastered the essentials of programmatically accepting shipping requests and tracking transaction statuses! But wait, there’s even more! Imagine being able to trigger notifications based on specific events, allowing your API client to respond swiftly. That’s where webhooks step in! Dive into our [Webhooks](/pages/guides/webhooks) guide next!