
The short answer: an API is the agreed way for one program to ask another for something. Instead of a person opening a page and clicking, your site sends a request to an address, with a method that says what it wants done, and gets back a response with a status code and, nearly always, data in JSON. That is how a shop talks to its payment operator, how a form sends an SMS, and how an automation reads a spreadsheet. This article is for people starting to code an integration, or ordering one from a developer and wanting to follow the conversation.
The parts of a request
| Part | What it is | In the example below |
| Endpoint | The address of one thing inside the API. In a REST API each thing (an order, a customer, a message) has its own. | https://api.example.com/v1/orders/123 |
| Method | The verb: GET reads, POST creates, PUT or PATCH changes, DELETE removes. | GET to read order 123; POST to create a new one. |
| Headers | Information about the request: who is asking (the key), what format is being sent and what format is wanted back. | Authorization, Content-Type, Accept |
| Body | The data sent when creating or changing something. In current APIs, usually JSON. | {"customer": "ana@example.com"} |
| Status code | The outcome in three digits: 2xx it worked, 4xx the problem is in the request, 5xx the problem is on the other side. | 200 OK when reading; 201 Created when creating; 401 if the key is wrong. |
| Response | What the API sends back: the data you asked for, or an error message, usually in JSON. | The order, with its status. |
A REST example, step by step
|
|
|
|
|
|
| An API key is a password. Calls to the API are made from the server (PHP, Node, Python), never from JavaScript running in the visitor’s browser: anything sent to the browser can be read by whoever visits the site. Keep the key out of the code, as in environment variables and secrets, and if it ever turns up where it should not, follow an API key or token has leaked. |
| Many services have a test environment (often called a “sandbox”), with its own keys and address, where you can create orders and payments with no real money. Use it until everything works, and only then switch to the live keys. |
|
Your integration does not answer the way the documentation says? Send us the endpoint, the method and the status code you get (never the key) and we will check whether anything on the hosting side is blocking it. Open a support ticket |
RECOMMENDED PRODUCT Web hosting with cPanel Domain and SSL included, daily backups and the panel you already know. from 321,75 MT/mo (3-year plan, with coupon) See plans |











