Request headers

Merchants must send appropriate headers with all requests.

HTTP headers

Field NameRequirementDescription
AuthorizationrequiredSee Authentication.
Content-TyperequiredAll POST and PUT requests must declare the content-type as application/json.
User-AgentrequiredSee below.
AcceptrecommendedAll requests must accept application/json or */*.

User-Agent header

User-Agent headers are used by the Cash App Afterpay team to identify API requests. A User-Agent header must be supplied with all Merchant API requests prior to placing any live transactions.

For example: MyAfterpayModule/1.0.0 (E-Commerce Platform Name/1.0.0; PHP/7.0.0; Merchantname/600032000) https://merchant.example.com

DescriptionExample Data AboveOther Merchant Examples
Afterpay PluginMyAfterpayModule/1.0.0Custom Plugin/1.0
Shopify Plugin/3.5.1
AfterpayCartridge/1.0
AfterpayExtension/2.9
PlatformE-Commerce Platform Name/1.0.0Websphere Commerce/8.1
Commerce Cloud/1.1
Adobe Commerce (Magento)/2.3.0
System InformationPHP/7.0.0PHP/7.2.18
Ruby/2.5.3
Java/8.3
Merchant IDMerchantname/600032000Merchantname/101113200
Merchantname/101931210
Merchant Website URLhttps://merchant.example.comhttp://www.merchantwebsite.com
In this case the Merchant ID is your company name or organisation name followed by an eight-digit number.