Errors

In this guide, we will talk about what happens when something goes wrong while you work with the API. Mistakes happen, and mostly they will be yours, not ours. Let's look at some status codes and error types you might encounter.

You can tell if your request was successful by checking the status code when receiving an API response. If a response comes back unsuccessful, you can use the error type and error message to figure out what has gone wrong and do some rudimentary debugging (before contacting support).


Status codes

Here is a list of the different categories of status codes returned by the MeSomb API. Use these to understand if a request was successful.

  • Name
    2xx
    Type
    undefined
    Description

    A 2xx status code indicates a successful response.

  • Name
    4xx
    Type
    undefined
    Description

    A 4xx status code indicates a client error — this means it's a you problem.

  • Name
    5xx
    Type
    undefined
    Description

    A 5xx status code indicates a server error — you won't be seeing these.


Error types

Whenever a request is unsuccessful, the MeSomb API will return an error response with an error type and message. You can use this information to understand better what has gone wrong and how to fix it. Most of the error messages are pretty helpful and actionable.

Here is a list of the two error types supported by the MeSomb API — use these to understand what you have done wrong.

  • Name
    subscriber-insufficient-balance
    Type
    undefined
    Description

    Insufficient balance in the account

  • Name
    subscriber-not-found
    Type
    undefined
    Description

    This account does not exist.

  • Name
    subscriber-internal-error
    Type
    undefined
    Description

    Issue during the processing. it can be: insufficient fund, timeout, wrong secret code...

  • Name
    generic-error
    Type
    undefined
    Description

    Error during the processing of the transaction

  • Name
    subscriber-limit-reached
    Type
    undefined
    Description

    This account has reached his limit.

  • Name
    provider-application-problem
    Type
    undefined
    Description

    Issue with service provider

  • Name
    provider-second-number-not-found
    Type
    undefined
    Description

    The second number of this account is not a valid provider number

  • Name
    unknown-issue
    Type
    undefined
    Description

    Unknown issue

  • Name
    subscriber-invalid-length
    Type
    undefined
    Description

    The phone number of this account is invalid

  • Name
    subscriber-invalid-min-amount
    Type
    undefined
    Description

    The amount is lower than the minimum amount allowed

  • Name
    subscriber-withdrawal-failed
    Type
    undefined
    Description

    When failure during the money withdrawal

  • Name
    subscriber-timeout
    Type
    undefined
    Description

    Operation timeout

  • Name
    subscriber-invalid-secret-code
    Type
    undefined
    Description

    Invalid secret code

  • Name
    subscriber-invalid-max-amount
    Type
    undefined
    Description

    The transaction amount exceed the max allowed

  • Name
    invalid-amount
    Type
    undefined
    Description

    Transaction amount is invalid

<span><span style="color: var(--shiki-color-text)">{</span></span>
<span><span style="color: var(--shiki-color-text)">    </span><span style="color: var(--shiki-token-string-expression)">&quot;code&quot;</span><span style="color: var(--shiki-color-text)">: </span><span style="color: var(--shiki-token-string-expression)">&quot;subscriber-insufficient-balance&quot;</span><span style="color: var(--shiki-color-text)">,</span></span>
<span><span style="color: var(--shiki-color-text)">    </span><span style="color: var(--shiki-token-string-expression)">&quot;details&quot;</span><span style="color: var(--shiki-color-text)">: </span><span style="color: var(--shiki-token-string-expression)">&quot;Insufficient balance in the account&quot;</span><span style="color: var(--shiki-color-text)">,</span></span>
<span><span style="color: var(--shiki-color-text)">    </span><span style="color: var(--shiki-token-string-expression)">&quot;support&quot;</span><span style="color: var(--shiki-color-text)">: </span><span style="color: var(--shiki-token-string-expression)">&quot;https://mesomb.atlassian.net/servicedesk/customer/portal/1&quot;</span></span>
<span><span style="color: var(--shiki-color-text)">}</span></span>
<span></span>