
Sometimes an API request expects information from another API request.
The API must send a call to DoExpressCheckoutPayment to complete the payment.Īn API request often fails because an API didn't get the expected information, such as the correct total, or the shipping data when a shipping address is requested elsewhere. However, the transaction is only set up it's not complete yet. The SetExpressCheckout method sets up the transaction with all required information, and it can even change the look of the checkout page. For example, the Express Checkout product requires two or three API method calls to complete a transaction. Often, you must make multiple API calls to have one successful transaction. PayPal API has compiled a complete listing of error codes.
If the ACK reports failure, you get an error code, a short message, and a long message.
If the ACK reports success, you get detailed information about your transaction.
Timeouts can result when either the sending server or the receiving server encounters problems such as a power failure or code glitch.įor PayPal, each API response will have an ACK, or acknowledgment of “Success” or “Failure.” Sometimes, though, this exchange fails this is called a timeout. If the request is received correctly, with no timeouts, you receive a response. Once you've built your API request, you should receive a response within a few seconds.
The response is the API’s message back to your application. It includes parameters such as the transaction amount, shipping address, tax amount, item description, or item quantity. The request is your application’s message to the API. Using an API, you can get the local weather, check incoming flights with a certain airline, create a Google Map, or create a payment with PayPal. An Application Programming Interface (API) is a safe gateway to use a company’s code or tool to accomplish a task.