A payment gateway API is the programming interface a payment gateway exposes so that a merchant's website, app or back-office system can submit and manage payments. Typical operations are requesting authorization, capturing an authorized amount, voiding it, issuing full or partial refunds, and storing card details through tokenization so that a token can be charged later without the card number. Results return in the response and through webhooks. It is a kind of payment API.
Merchants integrate in different ways that change their security burden. With a hosted payment page or hosted fields, card details are typed into elements served by the gateway, and the merchant's servers receive only a token, which keeps most systems out of scope for the PCI DSS card security standard. With a direct API integration the merchant's servers handle raw card data, giving full control over checkout but bringing those systems into scope and requiring a larger self-assessment questionnaire or an audit.