# Create a mock payment This API is only available in sandbox mode. Creates a mock payment of specified amount for any given Payment link. Endpoint: POST /payment/mock Version: 1.0.0 Security: JWT ## Request fields (application/json): - `amount` (integer, required) Amount in cents (minimum 100) Example: 10000 - `currency` (string, required) The currency code in ISO 4217 format Example: "AED" - `payment_method` (string) Required if no payin_id is passed. Enum: "BankTransfer" - `payin_id` (string) The unique identifier for the payin. Required if no payment_method is passed. Example: "payin_E602dMzgjpDC" - `remitter_name` (string) Name of the remitter. Optional, defaults to Non_Sanctioned_Entity Enum: "Sanctioned_Entity", "Non_Sanctioned_Entity" ## Response 201 fields (application/json): - `id` (string) The unique identifier for the payment. Example: "payt_E602dMzgjpDC" - `payin_id` (string,null) The unique identifier for the payin. This is set only for payments associated to a payin. Example: "payin_E602dMzgjpDC" - `payin_type` (string,null) The type of the payin. This is set only for payments associated to a payin. Enum: "payment_link", "orders", "add_funds" - `subscription_id` (string,null) The unique identifier for the subscription. This is set only for subscription-related payments. Example: "sub_68877570b5zeE" - `status` (string) The status of the payment. Enum: "success", "failed", "action_required", "in_progress" - `payment_currency` (string) The currency in which the customer pays. The currency code is in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, AED. Example: "AED" - `payment_amount` (number) The total amount the customer pays in cents (includes customer-borne fees if applicable). For example, 374580 cents is 3,745.80 AED. The currency is determined by the payment_currency field. Example: 374580 - `converted_currency` (string) The settlement currency after conversion. The currency code is in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, USD. Example: "USD" - `converted_amount` (number) The final amount after currency conversion in cents (includes all fees). For example, 102000 cents is $1,020.00. The currency is determined by the converted_currency field. Example: 102000 - `requested_currency` (string) The currency that was originally requested by the merchant. The currency code is in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, USD. Example: "USD" - `requested_amount` (number) The amount originally requested by the merchant in cents, excluding customer-borne fees. For example, 100000 cents is $1,000.00. The currency is determined by the requested_currency field. Example: 100000 - `purpose_code` (string) The purpose code of the payment. This should match the purpose code of the payin. Example: "S0001" - `transaction_reference_number` (string) The transaction reference number. This should match the payin id. Example: "payin_E602dMzgjpDC" - `sender_name` (string) The name of the sender. Example: "John Doe" - `metadata` (object) Additional metadata for the payment. - `error_message` (string) The error message, if any. - `error_code` (string) The error code for the respective error. Error code mappings can be found in the [product guide](../../../../product-guide/payin/payment#error-codes). Example: "PAYMENT_DECLINED" - `error_description` (string) The error description corresponding to error code. Example: "The payment attempt was declined. This could be due to issuer rejection, risk assessment, or restrictions on the card or account. The customer should contact their bank or try a different payment method." - `payment_date` (string) The date of the payment. Example: "2024-12-06T11:38:37.130Z" - `fee_bearer` (string) Fee bearer of the payment. Example: "customer" - `created_at` (string) The creation timestamp of the payment. Example: "2024-12-06T11:38:37.130Z" - `updated_at` (string) The last update timestamp of the payment. Example: "2024-12-06T11:38:37.130Z" - `customer_id` (string) The unique identifier for the customer. Example: "cust_E602sMzgjpDC" - `product_name` (string,null) The name of the product associated with the payment. Example: "ShieldGuard Insurance" - `product_description` (string,null) The description of the product associated with the payment. Example: "Simple, monthly insurance plan that covers your basic belongings and key digital assets" - `country` (string) The country of the sender. Country should be sent as a [ISO 3166-1 alpha-3](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-3) code. Example: "Ind" - `ordered_amount` (integer) The ordered amount. Example: 1000 - `ordered_currency` (string) The ordered currency. Example: "USD" - `fx_fee` (object) The foreign exchange fee charged for the payment. - `fx_fee.amount` (number) A positive integer representing the smallest currency unit. For example, if the amount is $299.00, then pass 29900 in this field. In the case of three decimal currencies, such as KWD, BHD and OMR, to represent an amount of 295.991, pass the value as 295990. And in the case of zero decimal currencies such as JPY, for amount ¥295, pass the value as 295. Example: 1000 - `fx_fee.currency` (string) The currency code in [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) format. For example, USD. Example: "USD" - `txn_fee` (object) The transaction fee charged for the payment. - `documents` (array) The attached documents for the payment. - `documents.id` (string) The unique identifier for the Document. Example: "doc_nYUqLpuYQ0M8" - `documents.type` (string) The type of the Document. Example: "invoice" - `documents.status` (string) Enum: "pending", "uploaded", "rejected", "approved" - `documents.rfi_doc_id` (string,null) The unique identifier for the RFI Document. This will be null if the document is not an RFI Document. Example: "rfidoc_nYUqLpuYQ0M8" - `settlement_id` (string) A unique identifier generated by Glomo for the settlement batch in which this payment is included. This ID can be used to track and reconcile payments against corresponding settlements. - `funds_available` (boolean) Indicates whether the funds for this payment are currently available with Glomo. Values: - true - Funds are available with Glomo and can be included in a payout or settlement - false - Funds are still in transit with Glomo's payment partners and are not yet available for use - `payment_method` (object) Specifies the method used by the customer to complete the payment. This can include various options such as swift_transfer, card, and other payment methods. - `payment_method.type` (string) The type of payment method used for the transaction. Enum: "swift_transfer", "card" - `payment_method.id` (string) The unique identifier for the payment method instance. Example: "swift_6883291fT7Rfw" - `payment_method.details` (object) Additional details specific to the payment method type. The structure varies based on the payment method type. - `auto_debit` (boolean,null) Indicates whether the payment was made via auto-debit for subscription payments. Returns true if it's an auto-debit payment, false if it's a manual payment for a subscription, or null if the payment is not associated with a subscription. Example: true ## Response 400 fields